Building Docker Images using Jenkins | jenkins build docker image from dockerfile
ThisstepcreatesanewprojectwhichJenkinswillbuildviaournewagent.Theprojectsourcecodeisathttps://github.com/katacoda/katacoda-jenkins-demo[1].TherepositoryhasaDockerfile;thisdefinestheinstructionsonhowtoproducetheDockerImage.Jenkinsdoesntneedtoknowthedetailsofhowourprojectisbuilt.Task:CreateNewJobOntheJenkinsdashboard,selectCreatenewjobsGivethejobafriendlynamesuchasKatacodaJenkinsDemo,selectFreestyleprojectthenclickOK.ThebuildwilldependonhavingaccesstoDocker.Usingthe"Restrictwherethisprojectcan...
This step creates a new project which Jenkins will build via our new agent. The project source code is at https://github.com/katacoda/katacoda-jenkins-demo[1]. The repository has a Dockerfile; this defines the instructions on how to produce the Docker Image. Jenkins doesnt need to know the details of how our project is built.
Task: Create New Job On the Jenkins dashboard, select Create new jobs Give the job a friendly name such as Katacoda Jenkins Demo, select Freestyle project then click OK. The build will depend on having access to Docker. Using the "Restrict where this project can be run" we can define the label we set of our configured Docker agent. The set "Label Expression" to docker-agent. You should have a configuration of "Label is serviced by no nodes and 1 cloud".If you see the error message There’s no agent/cloud that matches this assignment. Did you mean ‘master’ instead of ‘docker-agent’?, then the Docker plugin and the Docker Agent has not been Enable...