JenkinsWithDocker

Repository showing how to setup Jenkins run on Docker

MIT License

Stars
1
Committers
1

Jenkins with Docker

Repository showing how to setup Jenkins run on Docker.

1. Build DockerFile

docker image build -t oskardudycz/jenkins .

2. Login to you docker account

docker login

3. Push image to Docker Hub

docker image push oskardudycz/jenkins

4. Set secrets

printf "admin" | docker secret create jenkins-pass -
printf "admin" | docker secret create jenkins-user -

5. Start Jenkins (in Docker Swarm)

docker stack deploy -c jenkins.yml jenkins

6. Open Jenkins in browser. Login with username and password passed in secrets (eg. admin, admin).

7. Create job definition.

8. Copy job definition with:

curl -s http://admin:admin@localhost:8080/job/Backend/config.xml --header "Content-Type: application/xml" | "backend-config.xml"

9. Stop Jenkins

docker stack rm jenkins

10. Remove secrets

docker secret rm jenkins-user

docker secret rm jenkins-pass

Important links