Search⌘ K

Exercise Solution

Explore how to create Docker images by writing Dockerfiles and using command-line tools. Learn to build images, start containers, and pass environment variables, preparing you for advanced storage and networking concepts in Docker.

We'll cover the following...
  • Create a file named Dockerfile and add the following code to it:
Shell
FROM node:11-alpine
ENV diameter=4.0
COPY compute.js .
CMD node compute.js
  • Open a command-line. Change the current ...