DEV Community

Elliot Parker
Elliot Parker

Posted on

Getting Started with Docker

Docker

At the base, Docker is a container management service. It is very powerful because it acts as a platform to develop, run, and ship applications. It is lightweight and secure while containing everything necessary for running applications. It also allows for running multiple containers from one host.

Play With Docker

Play With Docker is the tutorial provided to get familiar with Docker. There are a few options, a 101 tutorial, a lab environment, and other learning materials. It is very easy to set up, just download the desktop version and run the command docker run -d -p 80:80 docker/getting-started in the terminal to open the tutorial. It walks you through step-by-step what to do to set up the tutorial and your first application.

Image description

Follow the instructions and you’re all set – you made your first containerized application!

Image of ToDo app built with Docker

Using Docker with Existing Apps

As we saw above, it’s very easy to get started using Docker and it’s still easy to utilize for your own projects. If you regularly use node/npm in your development, there is a very helpful guide on their Dockerizing tutorial.

It follows a similar setup as the Play With Docker example in creating a Dockerfile (shown below) and a .dockerignore file, which is useful for dealing with the node modules and logs so they don’t get copied into the image.

Dockerfile for Node app, from Node Dockerizing guide

I have also added an example of a docker-compose file, used to define and run apps that are composed of multiple containers.

docker-compose file for news api found at https://github.com/heyMP/news-api-workshop

The service is pretty easy to understand overall, but they also provide really helpful guides and reference sheets with their extensive documentation if you do run into any problems.

Top comments (0)