Tech bytes# Running Jenkins in a Docker Container
Would you like to use Jenkins in your machine and don't want to follow the traditional installation process ? If your say YES - then follow along this brief article !
This article assumes you have some idea of what docker is and how to use it. The pre-requisites to get started are:
Dockerrunning in your machine
If you are completely new to docker, I would highly recommend starting from here.
- Create a folder called build and add a
Dockerfilein it with content as below.
RUN apk add docker
- Create a
- Run the below command to start the service:
docker-compose up -d
- Open the browser at:
- We get a jenkins screens as below for the initial administrator password
- Get the password from:
docker-compose exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword
- After entering the password from above step, Jenkins shows the plugin selection screen.
After the successful installation of the required plugins you will be redirected to Jenkins Dashboard page. You may create an admin user if required.
That's it. You can use Jenkins now to create and run jobs as long as the container is running :)