I'm pretty new to Docker and trying to get my first (real) image up-and-running. I've written my Dockerfile:
WORKDIR /myapp
VOLUME /myapp/configuration
VOLUME /etc/asterisk
VOLUME /usr/share/asterisk/sounds
So my container should start in /myapp
and I should be able to mount external volumes to configure my app (configuration
), Asterisk and its sounds.
Though, when I start a container with my image:
docker run -it \
--entrypoint /bin/bash myapp \
-v $(pwd)/asterisk:/etc/asterisk \
-v $(pwd)/configuration:/myapp/configuration \
-v $(pwd)/asterisk/sounds:/usr/share/asterisk/sounds
It gives me the following error:
/bin/bash: /home/me/Docker/asterisk:/etc/asterisk: No such file or directory
I really don't understand why. I've verified it was not a line-ending issue (CRLF
rather than expected LF
for example), and it's not. I really don't know.
If it counts, I'm running elementary OS Loki.
Please suggest.
I found what the problem was, my hint was the unusual /bin/bash
beginning the line.
Actually, it was interpreting my -v
options as options for the entrypoint, and bash didn't understand it.
I moved my lines (--entrypoint
is now the last option) and it works like a charm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With