Docker is a container technology that helps easier application deployment by providing an abstraction over Linux OS. In this tutorial, I will go through creating a simple (simplest) docker container and deploy a very basic web-page that runs on port 3000.

To install docker run sudo apt-get install docker.io (in ubuntu). You might have to restart the OS after the installation.

1. Dockerfile

To create a docker file (configuration file used by docker to create a docker image). Run following commands.

Edit the apt-get section to add packages you need to run your application. The next block of code downloads a web page to host inside /home/nonroot/ directory. The final block of code runs python’s SimpleHTTPServer to host the directory containing the file.

2. Build docker image.

$ sudo docker build -t=docker-example .
Successfully built <image-id>

3. Run docker image

Conclusion

After this installation, you should be able to modify this tutorial to bundle your application specific packages and distribute your application without conflicting with dependencies. You can publish your package to https://registry.hub.docker.com/search?q=library for easier lookup and installation.