While learning docker I was given a start.sh script to run to start up and use docker locally, in getting more accustomed to docker I was ready to start making my own nodes on top of the repo already present, I was told to volume mount from the start script to be able to use my own files and when I tried to edit the script I somehow have broken it . before when I could enter and use the repo from running ./start.sh name image:tag
now I simply get an error stating “docker run” requires at least 1 argument." attached is the bash files code, any help would be greatly appreciated as I need to have docker working again hopefully soon !
Removing this blank line may help. The \ makes the next (now blank) line be part of the docker run command, but the line $DOCKER_IMAGE_NAME is not concatenated to that.
That said, it would just be an extra line like, for example, the --env ... \ lines. As you already have some --volume lines (which is the long name for -v), I’d add it around these lines, but that’s a matter of taste.
So, to mount some subfolder of your home directory into the container:
docker run -it --rm \
... \
--volume=$XSOCK:$XSOCK:rw \
--volume=$XAUTH:$XAUTH:rw \
--volume="$PWD/some/local/sub/folder":/some/folder/in/the/container:rw \
... \
--gpus all \
$DOCKER_IMAGE_NAME
(I’m actually not sure if :rw is supported, or if that’s just the default anyhow.)
And just in case you did not realize: the trailing backslash \ characters (without any whitespace after those) in your docker run command are only used to make things easier to read. In Linux, the following are often just the same:
some-command with a long list of options and arguments
some-command \
with \
a long list \
of options \
and arguments