Exploring Docker


I’ve been studying O’Reillys Docker Deep Dive 3rd ed, and I find it pretty good. It touches upon high level and detailed aspects but is written in such a way that I find it easy to read and understand. The provided examples and hands-on tutorials are simple to work with, run, and to understand the concepts. I feel like I am better understanding this cool technology.

After having read a lot of the abstract and also technical commands around working with docker images pulled from a repository, I’m now going to containerize a Node.js app (my first one- woot!). Here’s how I did it.

  1. Get the code from Github 2. Create the Dockerfile 3. Containerize the app 4 Run the app 5. Test the app

I downloaded a simple node.js application code from Github, which contained folders of views, node_modules and files package-lock.json, package.json, app.js, compose.yml, README.md. Next, I ran the docker init to create a Dockerfile.

$ docker init

This presented an interactive choice of input such as application platform (node.js), version of node.js to be used, the package manager to be used, what command to start the app, and the port that the server will listen on. Then, a few files are created, including Dockerfile.

$ docker build -t myContainer .

I had followed this article on using Visual Studio Code Dev Containers to set up my work environment before doing all of this, as part of sys config.

This article to be continued- first I am going to pivot to focus on bash shell scripting 🙂


Leave a comment