Task "Docker Volumes Mapping"

I got the task with description:

The Nautilus DevOps team is testing applications containerization, which issupposed to be migrated on docker container-based environments soon. In today's stand-up meeting one of the team members has been assigned a task to create and test a docker container with certain requirements. Below are more details:

a. On App Server 2 in Stratos DC pull nginx image (preferably latest tag but others should work too).
b. Create a new container with name games from the image you just pulled.
c. Map the host volume /opt/itadmin with container volume /var. There is an sample.txt file present on same server under /tmp; copy that file to /opt/itadmin. Also please keep the container in running state.

The problem is that if you mount any volume on /var inside container, you are breaking a whole lot of things. nginx included.

Hello,

You will not be breaking nginx if you map the host volume to the docker container volume. The idea here is for you to run (docker exec -it games(container_name) bash) and you will be able to see the file you copied into the host volume(/opt/itadmin)

I did not say that you will be breaking nginx if you map the host volume to the docker container volume.
I said that you will break it if you mount dir on /var.
/var is an essential directory in Linux FHS and contains a whole bunch of needed subdirectories including /var/run used (or was used at the time) by nginx in the docker container to store its pid file or /var/log for storing log files. And of course, nginx fails to start if it can’t access /var/run or /var/log