1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Docker

Exercise

Working in the command-line

A Dockerfile is just a textfile and creating or editing it can be done using any text editor. However since the default way to work with Docker is through the Command Line Interface, it's convenient to also edit Dockerfiles using the command line. Let's refresh our memory on how to navigate the file system and create or edit a Dockerfile with the command line.

Instructions 1/4

undefined XP
    1
    2
    3
    4

Create a file called Dockerfile in the current working directory.

  • Use touch Dockerfile; the touch command will create an empty file for you.

  • Or use nano Dockerfile, which will create an empty file but also open the nano text editor, which you then have to save using CTRL+s after which you can exit with CTRL+x.