From the course: Web Servers and APIs using C++

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding a volume

Adding a volume - C++ Tutorial

From the course: Web Servers and APIs using C++

Start my 1-month free trial

Adding a volume

- [Instructor] We are going to work on our host machine by build and run on the container. In order to edit files on the Docker container from our host machine, we are going to create a volume. A volume is a directory shared by the host machine and one or more Docker containers. We add a volume with the -v option of the docker run command. The volume option begins with a -v, is followed by a space, and two halves separated by a colon. The left half is the absolute path to the directory of the host machine. The right half is the absolute path to the directory on the container. I am going to create my volume using the cppweb directory that I created on the desktop. Here is the Docker command to do that. Please substitute your directory path for mine. So it's docker run - v /Users /troymiles /Desktop /cppweb: /usr/src and /cppweb -ti cppbox: latest bash. Do note, the rest of the command is stuff we've seen before. The -ti puts Docker in terminal interactive mode, cppbox:latest is our…

Contents