[Support] binhex - Jenkins


binhex

38 posts in this topic Last Reply

Recommended Posts

Ok, I think I follow! I wasn't aware that I could have 2 slaves in one Jenkins job, so I will look into this.

I wholeheartedly agree that if I could do it all with Docker, I should, but unless something has changed, I don't believe I can. I am developing .Net applications which need the Windoze OS to compile and test, I believe?

Incidentally, I am not wanting to create or delete the VM (which would, as you say, be slow), only start it up and shut it down. I don't want it to be left running 24x7, just fired up to do a build and then shut down again afterwards.

Thank you once again for your support.

Link to post
  • 8 months later...

Hey there!

 

Love the apps.

 

This is my first time setting up a jenkins server and this is more of a general jenkins question so feel free to say sorry cant help but after a couple of days of googling and trying various things im just at a loss so i thought i would try here also,

 

Im trying to add an ssh key via the credentials plugin, to checkout my private github repos for testing and ci deployments but no matter what i try it seems to think my private key is invalid. You wouldnt happen to know where the hell i enter the public key for a private key? as the plugin wants a username not the public key (i also tried my username for github juust incase). Ive seen many mentions of using an ssh agent but that just seem a weird way to go about it.

 

Thanks in advance!

 

edit: infact re-reading the responses in this thread am i actually supposed to have say a ubuntu vm running and use that as an agent rather than relying on the docker image as the agent?

Edited by phyzical
Link to post
1 hour ago, phyzical said:

Im trying to add an ssh key via the credentials plugin, to checkout my private github repos for testing and ci deployments but no matter what i try it seems to think my private key is invalid. You wouldnt happen to know where the hell i enter the public key for a private key? as the plugin wants a username not the public key (i also tried my username for github juust incase). Ive seen many mentions of using an ssh agent but that just seem a weird way to go about it.

ive never used ssh key for access to github, i tend to use personal access tokens, which are then defined as a 'username with password' in jenkins, see link below for how to generate one if you want to go down that route:-

 

https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line

Link to post
18 hours ago, binhex said:

ive never used ssh key for access to github, i tend to use personal access tokens, which are then defined as a 'username with password' in jenkins, see link below for how to generate one if you want to go down that route:-

 

https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line

hey thanks for the reply!

 

unfortunately github is only 1 step for me, i then need to checkout a bitbucket repo for my common infrastructure (which access tokens may also work) and then i will need to be able to deploy to my host box so i will still need ssh keys to work :( guessing your normal usecase is just for testing and not deployment?

 

 i will keep tinkering and see if i can get it to work. worse case i suppose i can fall back to the vm solution for a build agent, just trying to avoid it if i can at this time.

 

i will post back when i get to a solution incase it helps someone in the future.

 

Thanks again!

Link to post

just a followup incase anyone else runs into this.

 

Jenkins supports private keys but there is nowhere to upload the public key, so what you need to do is either copy the private and public keys in question onto the container or just run

Quote

pacman -S openssh

then generate an ssh key on the container, then upload that private key into jenkins

Link to post
  • 1 month later...

Hello,

 

Thanks for maintaining this container, its working great so far.

 

However, I did run into a problem and I'm sure I am just not understanding something correctly, but somehow I cannot get Jenkins to run a docker job.

 

I have a very simple jenkinsfile:

pipeline {
    agent {
        docker {
            image 'node:13-alpine'
            args '-p 3000:3000'
        }
    }
    stages {
        stage('Build') {
            steps {
                sh 'npm install'
            }
        }
    }
}

I have enabled the docker plugin for Jenkins and added a docker installation in the Global Tool Configuration:

5b4f0371f4.png

 

And finally I also passed the docker.sock to the container:

2367f624a0.png

 

However Jenkins build fail with "docker: command not found"

 

What am I missing? I have been searching for an answer for a couple of hours now, but I can't find a solution.

 

Link to post
  • 3 months later...

@oko2708

i might have done it wrong but i got it working by exposing the docker port on my unraid box then

configuring a cloud tcp://192.168.XX.XX:XXXX

then i just create an cloud agent template

this was also a bit annoying as the docker image then needed to apply the jlnp agent stuff

i.e `FROM jenkins/jnlp-slave`

 

if you figure out how to "just use docker images" let me know as it feels kinda iffy.

 

@binhex

i updated my image earlier today and then jenkis just died prompting something along the line of

` libfreetype.so.6: cannot open shared object file:` in JDK 8. is this just a  jenkis issue? i assume your auto building based on tags in jenkins land or something.

 

i just rolled back to 2.239 for now

Link to post

+1 for the `libfreetype.so.6` error on the latest release. First two lines of the error received when accessing the web console below.

 

AWT is not properly configured on this server. Perhaps you need to run your container with "-Djava.awt.headless=true"? See also: https://jenkins.io/redirect/troubleshooting/java.awt.headless

java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-8-openjdk/jre/lib/amd64/libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory

Tried adding `-Djava.awt.headless=true` as a java option and still no dice. This thread looked somewhat related: https://github.com/GoogleContainerTools/distroless/issues/321

Link to post
On 7/14/2020 at 5:39 AM, Grifsworld said:

I am also having the libfreetype.so problem! I have also pinned to 2.242-1-01 with no issues.

fixed the image, a new image is now building, check for updates in an hour from now.

Link to post
  • 2 weeks later...

I was getting an error with this container after updating, about it missing a dir.

chown: cannot access '/var/cache/jenkins': No such file or directory

I ended up fixing it by adding this as a post argument, and I was wondering if this is caused by something strange on my install or an issue with the container.

; docker exec binhex-jenkins /bin/bash -c "mkdir /var/cache/jenkins"

 

Edit: After some more usage it seems to be broken, these are my container settings any help would be appriciated. https://imgur.com/a/DiZN5vD (add me on discord if you want any more info @rtm516#2107)

Edited by rtm516
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.