[steve ~]$ id steve
uid=1000(steve) gid=1000(steve) groups=1000(steve),10(wheel),975(vboxusers),1002(docker)
User a persistent volume (to keep data), and the :z option to deal with selinux
[steve ~]$ docker run -p 8080:8080 -p 50000:50000 -v /home/steve/jenkins:/var/jenkins_home:z jenkins
Create repo on github, push code and makefile
https://github.com/bugwhine/hellojenkins
Install gcc and related tools into jenkins container
[steve ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
04105a89f166 jenkins "/bin/tini -- /usr/lo" 5 minutes ago Up 5 minutes 0.0.0.0:8080->8080/tcp, 0.0.0.0:50000->50000/tcp ecstatic_williams
[steve ~]$ docker exec -u root 04105a89f166 apt-get -y install gcc make
Create job in jenkins
- Source Code Management
- git
- Repository URL: git@github.com:bugwhine/hellojenkins.git
- Credentials: bugwhine (add using dropdown)
- Build
- execute shell
- make
Build now
No comments:
Post a Comment