...

/

Mounting a Volume Using Compose and Sharing Images

Mounting a Volume Using Compose and Sharing Images

Learn how to mount a volume using Compose and how to share images.

Mounting a volume

Before we leave our docker-compose.yml, let’s make a small addition. The -v option allows us to mount a local directory inside a container with docker run. By using this, the Rails project files generated inside the container would be available on our local machine. A mounted local volume represents some filesystem that is shared between your local machine and the container. Files in the mounted volume have synced both ways between your local filesystem and the container.

Because of this, a local volume mount can allow us to develop ...