Execute via command
sudo docker run --name nginx -d -p 80:80 -v $PWD/nginx/conf:/etc/nginx
nginx
The container was created successfully, but could not be started.
You can see it through the log
`
2017/05/24 12:13:34 [emerg] 1#1: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
`
If I share the /etc/nginx/conf.d directory, there is no problem. May I ask why this is happening? Is it a permissions issue?
Wow, buddy, you just killed nginx. Many files of nginx are under /etc/nginx. Don’t mount them like this, just mount a file directly
The following is an example of my arrangement using docker-compose