DOCKERFILE
Let's create a Dockerfile and automate some tasks rather than manually typing command. Because we love Automation and we are Lazy :)
Last updated
Let's create a Dockerfile and automate some tasks rather than manually typing command. Because we love Automation and we are Lazy :)
Last updated
To create a DockerFile we will be using vi editor so run the sudo vi Dockerfile
command. Now start typing or copy:
save the file by typing esc :wq
Now we have Dockerfile with all the instructions ready. Let's build a image by running :
sudo docker build -t tomcatimage .
Lets run a container using the same command we used previously:
COMPLETED!! We have successfully built an image and ran a container using Dockerfile and now you can access your code/application on IP:8080/webapps/
BUT! BUT!! what if I say we can automate more!!!! You don't believe me? Check Next section to see the magic where we will provide commands to JENKINS , which will automate creating Docker images and containers for us without SSH-in our EC2 server.