Mount container in background

Hello everyone,

I am a newbie in docker and I am studying about this. I am trying run this command:

sudo docker run ‐d ‐p 8080:80 ubuntu/nginx /usr/sbin/nginx ‐g “daemon off;”

but the result this command is: docker: Error parsing reference: “‐d” is not a valid repository/tag.
The goal this command is mount a a container in background. But I can’t find parameter -d in docker manual.

What did I do wrong?

The image ubuntu/ngnix does not exist in hub.docker.com. You can try instead:
sudo docker run ‐d ‐p 8080:80 nginx /usr/sbin/nginx ‐g “daemon off”

1 Like

Hello,

Thanks for your help, but I was digit wrong this command.
The image ubuntu/nginx is a image on my pc, I created through a image ubuntu and after I installed on this image nginx server and created a new image after this.

A tip: Never copy commands on pdf file and past directly in terminal ubuntu. Because, exist a large possibility this command keep wrong character and this isn’t visibility, but the linux don’t see this command well.

Thanks

Same when you copy/paste from a word document !!!

I didn’t try this. But I can secure this occur all times you try character the pdf to terminal. Because, in the past, I copy character to terminal and it was works.

When I paste the string in pluma (editor on linux) or abiword (looks like with office or libreoffice) this string sounds nice. I can’t understand, but I think this problem associated with codification of the OS.

I’ve had issues with tooling before where they try to make things look “nice”. But most command-line tools expect options to start with one or two hyphens, but e.g. Slack will “helpfully” convert -- to a single Unicode em dash, which command-line tools won’t recognize. It sounds like that’s what the OP ran into. (Their command line as they pasted it certainly looked sensible enough.)