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.
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
Clone the repository in and use the ls -la command to verify the contents of the folder.
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.
List your images. Type 'docker images' in the CLI to see the new todoapp image.
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.
Now that you have containerized your application, you are able to create multiple todoapps.
That wraps it up for setting up with Docker
Top comments (1)
Thanks for the tutorial. It is going to make it easier to develop a app I am working on. Keep it up!