Menu
CoddyTech

Building An Image

Part of the Introduction to Docker section of Coddy's Terminal journey. Lesson 22 of 40.

Once you have a Dockerfile, docker build turns it into an image. The -t flag gives the new image a name (tag), and the . tells Docker to use the current directory as the build context:

docker build -t myimage .

Docker runs each Dockerfile instruction in order, printing a Step line for each one, and finishes with:

Successfully built ...
Successfully tagged myimage:latest

After this, myimage shows up in docker images and you can run it like any other image.

challenge icon

Challenge

Easy

Open Dockerfile from the file tree, make FROM alpine its single instruction, and save it. Then build it into an image tagged mybox.

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Introduction to Docker

Practice on your own: Terminal playground