DEV Community

Cover image for Getting to know Docker and its Power
Matthew Wigoff
Matthew Wigoff

Posted on

Getting to know Docker and its Power

Why Docker is Powerful
Docker is a platform for building, running, and shipping applications. We can easily package up our applications with all the files they need to run on any Operating System. Docker uses containers. In this isolated environment, Docker can use many versions of node at the same time. If an application uses Node 14 and another application uses Node 9, both of these applications will run on the same machine at the same time because of Docker's containers. Another powerful aspect of a Docker container is that they don't take up much memory on your hard drive.

Image description src: https://jfrog.com/knowledge-base/the-basics-a-beginners-guide-to-docker/

Getting Started with Docker
Download Docker for your specific Operating System at Docker Docs
For Windows, you may get an installation incomplete message stating your Linux kernel needs to be updated. Follow the link in the error message and go down to step 4 to download the latest Linux kernel on your machine.

To get familiar with how Docker works go to Labs - Play with Docker and follow the steps here

  • In the session, click on Add New Instance to get started.
    Image description

  • Clone the repository in and use the ls -la command to verify the contents of the folder.

Image description

  • Establish the Container. In the CLI type 'docker build -t todoapp .' to build an image for the application. The (.) after the command tells the system the Dockerfile can be found in the current directory. The -t is to tag the image with a descriptive name.
    Image description

  • List your images. Type 'docker images' in the CLI to see the new todoapp image.
    Image description

  • Run the Container. Now that the image is established, use the command 'docker run -d -p 3000:3000 todoapp' to run the new container based on the new image.
    Image description

  • Now that you have containerized your application, you are able to create multiple todoapps.
    Image description

  • That wraps it up for setting up with Docker

Image description

Top comments (1)

Collapse
 
vpgmackan profile image
Mackan

Thanks for the tutorial. It is going to make it easier to develop a app I am working on. Keep it up!