Truecommand docker install

I don’t know how this is supposed to be typed:

"[hostdirectory]:/data"

for example:
"/opt/:/data" or
"/opt:/data" or
"/opt/data" or
"/opt/data/"

  1. or 2) should both work.

it’s useful to know this for using docker… -v flag is the “volume” flag. This is your storage for the container. There are three entries here: the first is the host directory, separated by a colon, followed by the apparent directory from the perspective of your containerized application. Another colon might follow with some options, often you will see ro for read only access but there are others listed here: Volumes | Docker Docs.

I believe the convention with linux is not to specify the trailing slash… so

-v /opt:/data

I don’t even think the quotes are necessary unless you are specifying a folder with a space in the name. In case you want to pass a previously created volume you can just replace /opt with volume_name.

Thank you :slight_smile: