Posts

Dockerfile

This post serves as a quick note on how to create a Dockerfile. It is not intended to be a comprehensive guide for the same. 1) FROM   = The image from dockerhub on which the   current image should be based on   2) MAINTAINER   = This is just a free text field where you put in your Name or email id, just so that people can identify the maintainer   3) EXPOSE = The port on which the container should be exposed. This can be overridden while doing a docker run command.   4)   ENTRYPOINT = The command to be executed when the container   strats   up.   For Example: npm start   5) COPY   = used to copy the source code into the docker machine.   For   exmple : COPY . /var/www   Where .(dot) represents that the whole of current directory needs to be copied.   6) WORKDIR   = The root directory from where the commands need to be run. For example, while running npm start, the directory in the container from where it should be run.   7) RUN   = A command tha

Docker Commands

This post serves as a quick set of notes on some of the Docker commands. The intent of this post is not to explain what is Docker or how it works. Instead it is just a quick access to various Docker commands. Docker Machine   1) List of all Docker machines   docker-machine ls    2)  Start a Docker machine   docker-machine start <machine-name>    Ex: docker-machine start default   3)  Stop a Docker Machine:   docker-machine stop <machine-name>   Ex: docker-machine stop default   4)  Set the environment:   docker-machine env <machine-name>   Ex: docker-machine env default   Docker Client:   1) Pull an image from the docker hub:   docker pull <image-name>   Ex: docker pull hello-world   2) List of images installed on the current computer:   docker images   3) Remove an image from the computer:   docker rmi <image-name | image-id>   Ex:  docker rmi hello-world   Ex:  docker rmi 12324   4)