This repo follows The Ultimate Docker Course by Mosh Hamedani. This repo contains a Dockerfile and JS application which prints Hello World!
to the console. This README.md gives instructions on how to use Docker to create and use an image for this JS application.
To check the Docker version, run docker version
While inside the repo parent directory, run
docker build -t hello-docker .
-t hello-docker
assigns a tag
.
tells docker where to find a Dockerfile
Check that the image was made by running
docker images
or docker image ls
This image contains Alpine OS, node
, and our application files
Run the image
docker run hello-docker
>>> Hello World!
At this point we have run the image in our local machine.
An identical image was published by Mosh Hamedani, which we now use here.
To pull the image run docker pull codewithmosh/hello-docker
Verify by running docker images
To run the image, run docker run codewithmosh/hello-docker
To test this on a remote machine, let's use an instance from Play With Docker. So pull and run the image as described in the previous section.
Note: you can maximize the console by hitting Alt+Enter
, and again to minimize the console.