0

CentOS 7 - Docker version 1.13.1 - Docker-compose 1.21.1

So I came across this issue that wound up being a time sink and now that I have things working I'd like to understand the 'why'.

I have an Nginx container that has a volume for ./docker-volumes/nginx:/etc/nginx On the host in the ./nginx dir I have my sites-available and sites-enabled. There is a symbolic link in sites-enabled pointing to my .conf file in sites-available.

When docker-compose was ran everything came up nicely however it appeared (and ultimately was) just using the basic nginx.conf (which was pointing to include sites-enabled). When I exec'd into the nginx container and ls -lah'd I could see the *.conf in sites-enabled so thought nothing of it. Later on I decided to cat the .conf that is sitting in sites-enabled in the container and see if something was jank for some reason and that is when I noticed something, it told me that there was no file available. <- the mystery

After seeing that I deleted the symlink and just dropped the .conf in sites-enabled and boom everything worked as expected. The thing is I have this working on another server and the symlink works just fine.

So the big question is when I exec'd into the container I could see the symlinked file but then when I went to cat it it said no such file existed? Does this anything to do with CentOS, the way Docker deals with volumes etc? I understand this may be a very one off situation and doesn't appear to have any rhyme or reason.

If you know something please share, I really want some closure one this.

1
  • 1
    Could you add the output of ls -l ./docker-volumes/nginx ? Apr 20, 2019 at 11:37

0

You must log in to answer this question.

Browse other questions tagged .