Use the absolute path to the file instead of a relative path.
this post was submitted on 16 Feb 2024
5 points (85.7% liked)
Docker
1076 readers
6 users here now
founded 1 year ago
MODERATORS
best way:
$(pwd)/ngnix.conf:<container path>
When I change the path to this...
docker container create --name nginx -v $(pwd)/nginx.conf:/etc/nginx/conf.d/nginx.conf -v $(pwd):/app/ -p 80:80 docker.io/nginx
It does not seem to make a difference since when I go to localhost in my browser, I am still greeted with the "Welcome to nginx!" page.