This is first part we will be “dockerizing” a simple node application and pushing the image to docker hub.

App structure will be simple and look like this.

app_structure

We will run a simple node server.

Dockerfile will have the following instructions to build our image.

Now to build our image using the instructions in our Dockerfile. In our terminal window we will run this command.

If everything checks out after running docker build then if you run docker images, you should see your newly created image.

docker_images

Now to push our newly created image to https://hub.docker.com/. You will need to create a repository and name it according to docker hub specs.

docker_push

Here is a link to the repo on docker hub.
https://hub.docker.com/r/aldomatic/nodedemo/