docker build . -t name_image:v1
docker run -d -it -p 3000:3000 name_image:v1
curl http://127.0.0.1:3000
Docker image can be built, we’ll want to do it automatically every time there is a change to the application code.
Build project using docker (Dockerfile)
Deploy project using jenkins (Jenkinsfile)
Write a Jenkins Pipeline specification in a Jenkinsfile.
Now, we’ll just need to tell Jenkins two things:
- Where to find our code
- What credentials to use to publish the Docker image
docker run -it -d --name myjenkins -p 8080:8080 -p 50000:50000 -v /var/jenkins_home jenkins/jenkins