ajcruz
(AJ Cruz)
November 24, 2022, 6:57am
1
Hey y’all, kind of a Docker noob here, having problems with permissions getting set to root on a folder in a container and haven’t had any luck on the Googles.
The container already has a jobs folder with the correct permissions (nautobot:nautobot) UID 999.
I’m trying to get a file from my host into this folder. The file on the host has the correct permissions (nautobot:nautobt) also with UID 999.
In my docker-compose file I have this under volumes:
- /home/nautobot/nautobot-docker-compose/softwarelist.py:/opt/nautobot/jobs/softwarelist.py
When the container comes up, the softwarelist.py file is in the jobs folder with the correct permissions, but the jobs folder has the permissions changed to root:root.
What am I doing wrong? Thanks!
meyay
(Metin Y.)
November 24, 2022, 7:31am
2
Mounting a file into a folder will not change the permission of the folder it was mounted in.
By any chance is the jobs folder itself configured as a volume? If so, the host folder will be bind mounted into the container folder and as such eclipsing the existing container folder. As a result the original permissions of the container folder become replaced by the permissions of the mounted folder.
You might want to share your complete compose file, so we see the full picture. And ls -l
outputs of everything relevant.
ajcruz
(AJ Cruz)
November 24, 2022, 3:52pm
3
I appreciate the reply. No, it isn’t. Here’s my docker-compose.yml file, the first container anyways there are several more in the file:
version: “3.7”
services:
nautobot:
image: nautobot
env_file:
- “local.env”
ports:
- “8443:8443”
restart: “unless-stopped”
volumes:
- /home/nautobot/nautobot-docker-compose/nautobot_config.py:/opt/nautobot/nautobot_config.py
- /home/nautobot/nautobot-docker-compose/nautobot.key:/opt/nautobot/nautobot.key
- /home/nautobot/nautobot-docker-compose/nautobot.crt:/opt/nautobot/nautobot.crt
- /home/nautobot/nautobot-docker-compose/uwsgi.ini:/opt/nautobot/uwsgi.ini
- /home/nautobot/nautobot-docker-compose/transposer.py:/usr/local/lib/python${PYTHON_VER}/transposer.py
- /home/nautobot/nautobot-docker-compose/softwarelist.py:/opt/nautobot/jobs/softwarelist.py
Here’s what the directory structure looks like without that last volume, jobs folder has a single init .py file:
nautobot@4a305d399aee:~$ ls -l
total 60
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 15:46 pycache
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 15:46 git
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 15:46 jobs
drwxr-xr-x 4 nautobot nautobot 4096 Nov 24 15:46 media
-rw-r–r-- 1 nautobot nautobot 1245 Nov 15 05:30 nautobot.crt
-rw------- 1 nautobot nautobot 1704 Nov 15 05:30 nautobot.key
-rw------- 1 nautobot nautobot 20555 Nov 15 03:27 nautobot_config.py
-rw-r–r-- 1 nautobot nautobot 103 Nov 15 03:27 plugin_requirements.txt
drwxr-xr-x 27 nautobot nautobot 4096 Nov 24 15:46 static
-rw------- 1 nautobot nautobot 2208 Nov 15 03:27 uwsgi.ini
nautobot@4a305d399aee:~$ cd jobs
nautobot@4a305d399aee:~/jobs$ ls -l
total 0
-rw-r–r-- 1 nautobot nautobot 0 Nov 24 15:46 init .py
And here’s what it looks like after I docker compose down, add the volume, and docker compose up:
nautobot@926ccdf264db:~$ ls -l
total 52
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 15:49 pycache
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 15:49 git
drwxr-xr-x 2 root root 4096 Nov 24 15:49 jobs
-rw-r–r-- 1 nautobot nautobot 1245 Nov 15 05:30 nautobot.crt
-rw------- 1 nautobot nautobot 1704 Nov 15 05:30 nautobot.key
-rw------- 1 nautobot nautobot 20555 Nov 15 03:27 nautobot_config.py
-rw-r–r-- 1 nautobot nautobot 103 Nov 15 03:27 plugin_requirements.txt
-rw------- 1 nautobot nautobot 2208 Nov 15 03:27 uwsgi.ini
nautobot@926ccdf264db:~$ cd jobs
nautobot@926ccdf264db:~/jobs$ ls -l
total 4
-rw------- 1 nautobot nautobot 509 Nov 24 06:17 softwarelist.py
I just noticed it seems to be re-creating the jobs folder. My Python module constructor (init .py) is gone.
ajcruz
(AJ Cruz)
November 24, 2022, 4:02pm
4
Thanks I appreciate the reply. No the jobs folder isn’t defined as a volume, here’s the docker-compose file, the first container anyways there are several others:
---
version: "3.7"
services:
nautobot:
image: nautobot
env_file:
- "local.env"
ports:
- "8443:8443"
restart: "unless-stopped"
volumes:
- /home/nautobot/nautobot-docker-compose/nautobot_config.py:/opt/nautobot/nautobot_config.py
- /home/nautobot/nautobot-docker-compose/nautobot.key:/opt/nautobot/nautobot.key
- /home/nautobot/nautobot-docker-compose/nautobot.crt:/opt/nautobot/nautobot.crt
- /home/nautobot/nautobot-docker-compose/uwsgi.ini:/opt/nautobot/uwsgi.ini
- /home/nautobot/nautobot-docker-compose/transposer.py:/usr/local/lib/python${PYTHON_VER}/transposer.py
- /home/nautobot/nautobot-docker-compose/softwarelist.py:/opt/nautobot/jobs/softwarelist.py
Before adding the volume for the Python job the directory structure looks like this:
nautobot@577d2a512f6d:~$ ls -l
total 60
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 16:00 __pycache__
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 16:00 git
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 16:00 jobs
drwxr-xr-x 4 nautobot nautobot 4096 Nov 24 16:00 media
-rw-r--r-- 1 nautobot nautobot 1245 Nov 15 05:30 nautobot.crt
-rw------- 1 nautobot nautobot 1704 Nov 15 05:30 nautobot.key
-rw------- 1 nautobot nautobot 20555 Nov 15 03:27 nautobot_config.py
-rw-r--r-- 1 nautobot nautobot 103 Nov 15 03:27 plugin_requirements.txt
drwxr-xr-x 27 nautobot nautobot 4096 Nov 24 16:01 static
-rw------- 1 nautobot nautobot 2208 Nov 15 03:27 uwsgi.ini
nautobot@577d2a512f6d:~$ cd jobs
nautobot@577d2a512f6d:~/jobs$ ls -l
total 0
-rw-r--r-- 1 nautobot nautobot 0 Nov 24 16:00 __init__.py
And after I add the last volume the directory looks like this:
nautobot@73c096d8db1e:~$ ls -l
total 52
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 15:55 __pycache__
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 15:55 git
drwxr-xr-x 2 root root 4096 Nov 24 15:55 jobs
-rw-r--r-- 1 nautobot nautobot 1245 Nov 15 05:30 nautobot.crt
-rw------- 1 nautobot nautobot 1704 Nov 15 05:30 nautobot.key
-rw------- 1 nautobot nautobot 20555 Nov 15 03:27 nautobot_config.py
-rw-r--r-- 1 nautobot nautobot 103 Nov 15 03:27 plugin_requirements.txt
-rw------- 1 nautobot nautobot 2208 Nov 15 03:27 uwsgi.ini
nautobot@73c096d8db1e:~$ cd jobs
nautobot@73c096d8db1e:~/jobs$ ls -l
total 4
-rw------- 1 nautobot nautobot 509 Nov 24 06:17 softwarelist.py
I just noticed it seems to be re-creating the jobs folder, my Python module constructor (init .py) is gone.
ajcruz
(AJ Cruz)
November 24, 2022, 4:09pm
5
And in case it’s relevant, here’s the entirety of the dockerfile I’m using to build the nautobot image:
ARG NAUTOBOT_IMAGE
ARG PYTHON_VER
FROM networktocode/nautobot:$NAUTOBOT_IMAGE-py$PYTHON_VER
COPY --chown=nautobot ./plugin_requirements.txt /opt/nautobot/
RUN pip install --upgrade pip wheel && \
pip install --no-warn-script-location -r /opt/nautobot/plugin_requirements.txt
ajcruz
(AJ Cruz)
November 24, 2022, 4:24pm
6
I’m struggling with this forum interface, twice now it looks like I lost the entire post when I try to save an edit, hopefully it doesn’t magically re-appear later and show three of them, but here it is again:
I appreciate your reply, no the jobs folder isn’t previously configured as a volume. Here’s my docker-compose file up to the first container, there are several others:
---
version: "3.7"
services:
nautobot:
image: nautobot
env_file:
- "local.env"
ports:
- "8443:8443"
restart: "unless-stopped"
volumes:
- /home/nautobot/nautobot-docker-compose/nautobot_config.py:/opt/nautobot/nautobot_config.py
- /home/nautobot/nautobot-docker-compose/nautobot.key:/opt/nautobot/nautobot.key
- /home/nautobot/nautobot-docker-compose/nautobot.crt:/opt/nautobot/nautobot.crt
- /home/nautobot/nautobot-docker-compose/uwsgi.ini:/opt/nautobot/uwsgi.ini
- /home/nautobot/nautobot-docker-compose/transposer.py:/usr/local/lib/python${PYTHON_VER}/transposer.py
- /home/nautobot/nautobot-docker-compose/softwarelist.py:/opt/nautobot/jobs/softwarelist.py
Before I add that last volume to mount the softwarelist.py file the directory structure on the container looks like this:
nautobot@577d2a512f6d:~$ ls -l
total 60
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 16:00 __pycache__
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 16:00 git
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 16:00 jobs
drwxr-xr-x 4 nautobot nautobot 4096 Nov 24 16:00 media
-rw-r--r-- 1 nautobot nautobot 1245 Nov 15 05:30 nautobot.crt
-rw------- 1 nautobot nautobot 1704 Nov 15 05:30 nautobot.key
-rw------- 1 nautobot nautobot 20555 Nov 15 03:27 nautobot_config.py
-rw-r--r-- 1 nautobot nautobot 103 Nov 15 03:27 plugin_requirements.txt
drwxr-xr-x 27 nautobot nautobot 4096 Nov 24 16:01 static
-rw------- 1 nautobot nautobot 2208 Nov 15 03:27 uwsgi.ini
nautobot@577d2a512f6d:~$ cd jobs
nautobot@577d2a512f6d:~/jobs$ ls -l
total 0
-rw-r--r-- 1 nautobot nautobot 0 Nov 24 16:00 __init__.py
When I docker compose down, add the volume, and docker compose up, the directory structure looks like this:
nautobot@f6abe8ac9140:~$ ls -l
total 52
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 16:21 __pycache__
drwxr-xr-x 2 nautobot nautobot 4096 Nov 24 16:21 git
drwxr-xr-x 2 root root 4096 Nov 24 16:21 jobs
-rw-r--r-- 1 nautobot nautobot 1245 Nov 15 05:30 nautobot.crt
-rw------- 1 nautobot nautobot 1704 Nov 15 05:30 nautobot.key
-rw------- 1 nautobot nautobot 20555 Nov 15 03:27 nautobot_config.py
-rw-r--r-- 1 nautobot nautobot 103 Nov 15 03:27 plugin_requirements.txt
-rw------- 1 nautobot nautobot 2208 Nov 15 03:27 uwsgi.ini
nautobot@f6abe8ac9140:~$ cd jobs
nautobot@f6abe8ac9140:~/jobs$ ls -l
total 4
-rw------- 1 nautobot nautobot 509 Nov 24 06:17 softwarelist.py
I just noticed it seems to be re-creating the jobs folder. My Python module constructor (init .py) is gone.
Also, I’m firing up another couple containers from a different compose file, the command I’m using to bring all the services up is:
docker compose --project-directory /home/nautobot/nautobot-docker-compose/ -f ./nautobot-docker-compose/docker-compose.yml -f ./nautobot-docker-compose/docker-compose.netimporter.yml up -d
ajcruz
(AJ Cruz)
November 24, 2022, 4:27pm
7
Here’s the entirety of docker-compose.yml:
---
version: "3.7"
services:
nautobot:
image: nautobot
env_file:
- "local.env"
ports:
- "8443:8443"
restart: "unless-stopped"
volumes:
- /home/nautobot/nautobot-docker-compose/nautobot_config.py:/opt/nautobot/nautobot_config.py
- /home/nautobot/nautobot-docker-compose/nautobot.key:/opt/nautobot/nautobot.key
- /home/nautobot/nautobot-docker-compose/nautobot.crt:/opt/nautobot/nautobot.crt
- /home/nautobot/nautobot-docker-compose/uwsgi.ini:/opt/nautobot/uwsgi.ini
- /home/nautobot/nautobot-docker-compose/transposer.py:/usr/local/lib/python${PYTHON_VER}/transposer.py
- /home/nautobot/nautobot-docker-compose/softwarelist.py:/opt/nautobot/jobs/softwarelist.py
nginx:
image: "nginx:${NGINX_VER}"
env_file:
- "/home/nautobot/nautobot-docker-compose/local.env"
ports:
- "80:80"
- "443:443"
depends_on:
- "nautobot"
restart: "unless-stopped"
volumes:
- /home/nautobot/nautobot-docker-compose/nginx.key:/etc/ssl/private/nginx.key
- /home/nautobot/nautobot-docker-compose/nginx.crt:/etc/ssl/certs/nginx.crt
- /home/nautobot/nautobot-docker-compose/nginx.conf:/etc/nginx/conf.d/nginx.conf
- /home/nautobot/nautobot-docker-compose/nautobot.crt:/usr/local/share/ca-certificates/nautobot.crt
nautobot-worker:
image: nautobot
env_file:
- "/home/nautobot/nautobot-docker-compose/local.env"
entrypoint: "nautobot-server rqworker"
healthcheck:
interval: "10s"
timeout: "10s"
start_period: "180s"
retries: 3
test: ["CMD", "nautobot-server", "health_check"]
depends_on:
- "nautobot"
restart: "unless-stopped"
volumes:
- /home/nautobot/nautobot-docker-compose/nautobot_config.py:/opt/nautobot/nautobot_config.py
- /home/nautobot/nautobot-docker-compose/transposer.py:/usr/local/lib/python${PYTHON_VER}/transposer.py
celery_worker:
image: nautobot
entrypoint: "sh -c 'nautobot-server celery worker -l $$NAUTOBOT_LOG_LEVEL'"
healthcheck:
interval: "10s"
timeout: "10s"
start_period: "180s"
retries: 3
test: ["CMD", "nautobot-server", "health_check"]
depends_on:
- "nautobot"
- "redis"
restart: "unless-stopped"
volumes:
- /home/nautobot/nautobot-docker-compose/nautobot_config.py:/opt/nautobot/nautobot_config.py
- /home/nautobot/nautobot-docker-compose/.secrets:/opt/nautobot/.secrets
- /home/nautobot/nautobot-docker-compose/transposer.py:/usr/local/lib/python${PYTHON_VER}/transposer.py
env_file:
- "/home/nautobot/nautobot-docker-compose/local.env"
tty: true
celery_beat:
image: nautobot
entrypoint: "sh -c 'nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL'"
healthcheck:
interval: "10s"
timeout: "10s"
start_period: "180s"
retries: 3
test: ["CMD", "nautobot-server", "health_check"]
depends_on:
- "nautobot"
- "redis"
restart: "unless-stopped"
volumes:
- /home/nautobot/nautobot-docker-compose/nautobot_config.py:/opt/nautobot/nautobot_config.py
env_file:
- "/home/nautobot/nautobot-docker-compose/local.env"
tty: true
redis:
image: "redis:${REDIS_VER}"
env_file:
- "/home/nautobot/nautobot-docker-compose/local.env"
command:
- "sh"
- "-c" # this is to evaluate the $REDIS_PASSWORD from the env
- "redis-server --appendonly yes --requirepass $$NAUTOBOT_REDIS_PASSWORD" ## $$ because of docker-compose
restart: "unless-stopped"
db:
image: "postgres:${POSTGRES_VER}"
env_file:
- "/home/nautobot/nautobot-docker-compose/local.env"
environment:
NAUTOBOT_DB_ENGINE: "django.db.backends.postgres"
volumes:
- "db_data:/var/lib/postgresql/data"
restart: "unless-stopped"
volumes:
db_data:
And docker-compose.netimporter.yml:
---
version: "3.7"
services:
batfish:
image: batfish/batfish:${BATFISH_VER}
env_file:
- /home/nautobot/nautobot-docker-compose/local.env
ports:
- "9997:9997"
- "9996:9996"
restart: "unless-stopped"
network_importer:
image: network-importer
stdin_open: true
tty: true
env_file:
- /home/nautobot/nautobot-docker-compose/local.env
depends_on:
- "batfish"
volumes:
- /home/nautobot/nautobot-docker-compose/network-importer/network_importer.toml:/local/network_importer.toml
- /home/nautobot/nautobot-docker-compose/nginx/nginx.crt:/usr/local/share/ca-certificates/nginx.crt
- /home/nautobot/nautobot-docker-compose/network-importer/arista_eos.py:/local/network_importer/drivers/arista_eos.py
restart: "unless-stopped"
meyay
(Metin Y.)
November 24, 2022, 5:30pm
8
Just use docker compose --project-directory /home/nautobot/nautobot-docker-compose/ -f ./nautobot-docker-compose/docker-compose.yml -f ./nautobot-docker-compose/docker-compose.netimporter.yml config
to get the effective compose file.
It gets easier to read.
Though the behavior of the jobs folder inside the container seems puzzling, why would the permission change, just because you bind an additional file from the host to the container folder… I assume you are use docker-ce on linux, correct?
I still need to ingest the information. Though, it might take some time.
ajcruz
(AJ Cruz)
November 24, 2022, 5:33pm
9
Ya no worries I appreciate you. Here’s the output of the config command:
name: nautobot-docker-compose
services:
batfish:
environment:
MARIADB_DATABASE: nautobot
MARIADB_PASSWORD: ajlab.local
MARIADB_ROOT_PASSWORD: ajlab.local
MARIADB_USER: nautobot
NAUTOBOT_ALLOWED_HOSTS: localhost,nginx,nautobot.ajlab.local,192.168.254.20
NAUTOBOT_CACHEOPS_REDIS: redis://:ajlab.local@redis:6379/1
NAUTOBOT_CHANGELOG_RETENTION: "0"
NAUTOBOT_CONFIG: /opt/nautobot/nautobot_config.py
NAUTOBOT_CREATE_SUPERUSER: "true"
NAUTOBOT_DB_HOST: db
NAUTOBOT_DB_NAME: nautobot
NAUTOBOT_DB_PASSWORD: ajlab.local
NAUTOBOT_DB_USER: nautobot
NAUTOBOT_HIDE_RESTRICTED_UI: "True"
NAUTOBOT_LOG_LEVEL: WARNING
NAUTOBOT_MAX_PAGE_SIZE: "0"
NAUTOBOT_NAPALM_PASSWORD: ajlab.local
NAUTOBOT_NAPALM_TIMEOUT: "30"
NAUTOBOT_NAPALM_USERNAME: admin
NAUTOBOT_REDIS_HOST: redis
NAUTOBOT_REDIS_PASSWORD: ajlab.local
NAUTOBOT_REDIS_PORT: "6379"
NAUTOBOT_SECRET_KEY: urrad240vzlws0303okqarsaj3909lykq5mbfteccejw5yvcsj
NAUTOBOT_SUPERUSER_API_TOKEN: gpi5ukyfi291a1en8d5tk6tgxppg5ycysi3z22ew
NAUTOBOT_SUPERUSER_EMAIL: ""
NAUTOBOT_SUPERUSER_NAME: admin
NAUTOBOT_SUPERUSER_PASSWORD: ajlab.local
PGPASSWORD: ajlab.local
POSTGRES_DB: nautobot
POSTGRES_PASSWORD: ajlab.local
POSTGRES_USER: nautobot
image: batfish/batfish:2022.09.08.86
networks:
default: null
ports:
- mode: ingress
target: 9997
published: "9997"
protocol: tcp
- mode: ingress
target: 9996
published: "9996"
protocol: tcp
restart: unless-stopped
celery_beat:
depends_on:
nautobot:
condition: service_started
redis:
condition: service_started
entrypoint:
- sh
- -c
- nautobot-server celery beat -l $$NAUTOBOT_LOG_LEVEL
environment:
MARIADB_DATABASE: nautobot
MARIADB_PASSWORD: ajlab.local
MARIADB_ROOT_PASSWORD: ajlab.local
MARIADB_USER: nautobot
NAUTOBOT_ALLOWED_HOSTS: localhost,nginx,nautobot.ajlab.local,192.168.254.20
NAUTOBOT_CACHEOPS_REDIS: redis://:ajlab.local@redis:6379/1
NAUTOBOT_CHANGELOG_RETENTION: "0"
NAUTOBOT_CONFIG: /opt/nautobot/nautobot_config.py
NAUTOBOT_CREATE_SUPERUSER: "true"
NAUTOBOT_DB_HOST: db
NAUTOBOT_DB_NAME: nautobot
NAUTOBOT_DB_PASSWORD: ajlab.local
NAUTOBOT_DB_USER: nautobot
NAUTOBOT_HIDE_RESTRICTED_UI: "True"
NAUTOBOT_LOG_LEVEL: WARNING
NAUTOBOT_MAX_PAGE_SIZE: "0"
NAUTOBOT_NAPALM_PASSWORD: ajlab.local
NAUTOBOT_NAPALM_TIMEOUT: "30"
NAUTOBOT_NAPALM_USERNAME: admin
NAUTOBOT_REDIS_HOST: redis
NAUTOBOT_REDIS_PASSWORD: ajlab.local
NAUTOBOT_REDIS_PORT: "6379"
NAUTOBOT_SECRET_KEY: urrad240vzlws0303okqarsaj3909lykq5mbfteccejw5yvcsj
NAUTOBOT_SUPERUSER_API_TOKEN: gpi5ukyfi291a1en8d5tk6tgxppg5ycysi3z22ew
NAUTOBOT_SUPERUSER_EMAIL: ""
NAUTOBOT_SUPERUSER_NAME: admin
NAUTOBOT_SUPERUSER_PASSWORD: ajlab.local
PGPASSWORD: ajlab.local
POSTGRES_DB: nautobot
POSTGRES_PASSWORD: ajlab.local
POSTGRES_USER: nautobot
healthcheck:
test:
- CMD
- nautobot-server
- health_check
timeout: 10s
interval: 10s
retries: 3
start_period: 3m0s
image: nautobot
networks:
default: null
restart: unless-stopped
tty: true
volumes:
- type: bind
source: /home/nautobot/nautobot-docker-compose/nautobot_config.py
target: /opt/nautobot/nautobot_config.py
bind:
create_host_path: true
celery_worker:
depends_on:
nautobot:
condition: service_started
redis:
condition: service_started
entrypoint:
- sh
- -c
- nautobot-server celery worker -l $$NAUTOBOT_LOG_LEVEL
environment:
MARIADB_DATABASE: nautobot
MARIADB_PASSWORD: ajlab.local
MARIADB_ROOT_PASSWORD: ajlab.local
MARIADB_USER: nautobot
NAUTOBOT_ALLOWED_HOSTS: localhost,nginx,nautobot.ajlab.local,192.168.254.20
NAUTOBOT_CACHEOPS_REDIS: redis://:ajlab.local@redis:6379/1
NAUTOBOT_CHANGELOG_RETENTION: "0"
NAUTOBOT_CONFIG: /opt/nautobot/nautobot_config.py
NAUTOBOT_CREATE_SUPERUSER: "true"
NAUTOBOT_DB_HOST: db
NAUTOBOT_DB_NAME: nautobot
NAUTOBOT_DB_PASSWORD: ajlab.local
NAUTOBOT_DB_USER: nautobot
NAUTOBOT_HIDE_RESTRICTED_UI: "True"
NAUTOBOT_LOG_LEVEL: WARNING
NAUTOBOT_MAX_PAGE_SIZE: "0"
NAUTOBOT_NAPALM_PASSWORD: ajlab.local
NAUTOBOT_NAPALM_TIMEOUT: "30"
NAUTOBOT_NAPALM_USERNAME: admin
NAUTOBOT_REDIS_HOST: redis
NAUTOBOT_REDIS_PASSWORD: ajlab.local
NAUTOBOT_REDIS_PORT: "6379"
NAUTOBOT_SECRET_KEY: urrad240vzlws0303okqarsaj3909lykq5mbfteccejw5yvcsj
NAUTOBOT_SUPERUSER_API_TOKEN: gpi5ukyfi291a1en8d5tk6tgxppg5ycysi3z22ew
NAUTOBOT_SUPERUSER_EMAIL: ""
NAUTOBOT_SUPERUSER_NAME: admin
NAUTOBOT_SUPERUSER_PASSWORD: ajlab.local
PGPASSWORD: ajlab.local
POSTGRES_DB: nautobot
POSTGRES_PASSWORD: ajlab.local
POSTGRES_USER: nautobot
healthcheck:
test:
- CMD
- nautobot-server
- health_check
timeout: 10s
interval: 10s
retries: 3
start_period: 3m0s
image: nautobot
networks:
default: null
restart: unless-stopped
tty: true
volumes:
- type: bind
source: /home/nautobot/nautobot-docker-compose/nautobot_config.py
target: /opt/nautobot/nautobot_config.py
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/.secrets
target: /opt/nautobot/.secrets
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/transposer.py
target: /usr/local/lib/python3.9/transposer.py
bind:
create_host_path: true
db:
environment:
MARIADB_DATABASE: nautobot
MARIADB_PASSWORD: ajlab.local
MARIADB_ROOT_PASSWORD: ajlab.local
MARIADB_USER: nautobot
NAUTOBOT_ALLOWED_HOSTS: localhost,nginx,nautobot.ajlab.local,192.168.254.20
NAUTOBOT_CACHEOPS_REDIS: redis://:ajlab.local@redis:6379/1
NAUTOBOT_CHANGELOG_RETENTION: "0"
NAUTOBOT_CONFIG: /opt/nautobot/nautobot_config.py
NAUTOBOT_CREATE_SUPERUSER: "true"
NAUTOBOT_DB_ENGINE: django.db.backends.postgres
NAUTOBOT_DB_HOST: db
NAUTOBOT_DB_NAME: nautobot
NAUTOBOT_DB_PASSWORD: ajlab.local
NAUTOBOT_DB_USER: nautobot
NAUTOBOT_HIDE_RESTRICTED_UI: "True"
NAUTOBOT_LOG_LEVEL: WARNING
NAUTOBOT_MAX_PAGE_SIZE: "0"
NAUTOBOT_NAPALM_PASSWORD: ajlab.local
NAUTOBOT_NAPALM_TIMEOUT: "30"
NAUTOBOT_NAPALM_USERNAME: admin
NAUTOBOT_REDIS_HOST: redis
NAUTOBOT_REDIS_PASSWORD: ajlab.local
NAUTOBOT_REDIS_PORT: "6379"
NAUTOBOT_SECRET_KEY: urrad240vzlws0303okqarsaj3909lykq5mbfteccejw5yvcsj
NAUTOBOT_SUPERUSER_API_TOKEN: gpi5ukyfi291a1en8d5tk6tgxppg5ycysi3z22ew
NAUTOBOT_SUPERUSER_EMAIL: ""
NAUTOBOT_SUPERUSER_NAME: admin
NAUTOBOT_SUPERUSER_PASSWORD: ajlab.local
PGPASSWORD: ajlab.local
POSTGRES_DB: nautobot
POSTGRES_PASSWORD: ajlab.local
POSTGRES_USER: nautobot
image: postgres:14
networks:
default: null
restart: unless-stopped
volumes:
- type: volume
source: db_data
target: /var/lib/postgresql/data
volume: {}
nautobot:
environment:
MARIADB_DATABASE: nautobot
MARIADB_PASSWORD: ajlab.local
MARIADB_ROOT_PASSWORD: ajlab.local
MARIADB_USER: nautobot
NAUTOBOT_ALLOWED_HOSTS: localhost,nginx,nautobot.ajlab.local,192.168.254.20
NAUTOBOT_CACHEOPS_REDIS: redis://:ajlab.local@redis:6379/1
NAUTOBOT_CHANGELOG_RETENTION: "0"
NAUTOBOT_CONFIG: /opt/nautobot/nautobot_config.py
NAUTOBOT_CREATE_SUPERUSER: "true"
NAUTOBOT_DB_HOST: db
NAUTOBOT_DB_NAME: nautobot
NAUTOBOT_DB_PASSWORD: ajlab.local
NAUTOBOT_DB_USER: nautobot
NAUTOBOT_HIDE_RESTRICTED_UI: "True"
NAUTOBOT_LOG_LEVEL: WARNING
NAUTOBOT_MAX_PAGE_SIZE: "0"
NAUTOBOT_NAPALM_PASSWORD: ajlab.local
NAUTOBOT_NAPALM_TIMEOUT: "30"
NAUTOBOT_NAPALM_USERNAME: admin
NAUTOBOT_REDIS_HOST: redis
NAUTOBOT_REDIS_PASSWORD: ajlab.local
NAUTOBOT_REDIS_PORT: "6379"
NAUTOBOT_SECRET_KEY: urrad240vzlws0303okqarsaj3909lykq5mbfteccejw5yvcsj
NAUTOBOT_SUPERUSER_API_TOKEN: gpi5ukyfi291a1en8d5tk6tgxppg5ycysi3z22ew
NAUTOBOT_SUPERUSER_EMAIL: ""
NAUTOBOT_SUPERUSER_NAME: admin
NAUTOBOT_SUPERUSER_PASSWORD: ajlab.local
PGPASSWORD: ajlab.local
POSTGRES_DB: nautobot
POSTGRES_PASSWORD: ajlab.local
POSTGRES_USER: nautobot
image: nautobot
networks:
default: null
ports:
- mode: ingress
target: 8443
published: "8443"
protocol: tcp
restart: unless-stopped
volumes:
- type: bind
source: /home/nautobot/nautobot-docker-compose/nautobot_config.py
target: /opt/nautobot/nautobot_config.py
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/nautobot.key
target: /opt/nautobot/nautobot.key
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/nautobot.crt
target: /opt/nautobot/nautobot.crt
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/uwsgi.ini
target: /opt/nautobot/uwsgi.ini
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/transposer.py
target: /usr/local/lib/python3.9/transposer.py
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/softwarelist.py
target: /opt/nautobot/jobs/softwarelist.py
bind:
create_host_path: true
nautobot-worker:
depends_on:
nautobot:
condition: service_started
entrypoint:
- nautobot-server
- rqworker
environment:
MARIADB_DATABASE: nautobot
MARIADB_PASSWORD: ajlab.local
MARIADB_ROOT_PASSWORD: ajlab.local
MARIADB_USER: nautobot
NAUTOBOT_ALLOWED_HOSTS: localhost,nginx,nautobot.ajlab.local,192.168.254.20
NAUTOBOT_CACHEOPS_REDIS: redis://:ajlab.local@redis:6379/1
NAUTOBOT_CHANGELOG_RETENTION: "0"
NAUTOBOT_CONFIG: /opt/nautobot/nautobot_config.py
NAUTOBOT_CREATE_SUPERUSER: "true"
NAUTOBOT_DB_HOST: db
NAUTOBOT_DB_NAME: nautobot
NAUTOBOT_DB_PASSWORD: ajlab.local
NAUTOBOT_DB_USER: nautobot
NAUTOBOT_HIDE_RESTRICTED_UI: "True"
NAUTOBOT_LOG_LEVEL: WARNING
NAUTOBOT_MAX_PAGE_SIZE: "0"
NAUTOBOT_NAPALM_PASSWORD: ajlab.local
NAUTOBOT_NAPALM_TIMEOUT: "30"
NAUTOBOT_NAPALM_USERNAME: admin
NAUTOBOT_REDIS_HOST: redis
NAUTOBOT_REDIS_PASSWORD: ajlab.local
NAUTOBOT_REDIS_PORT: "6379"
NAUTOBOT_SECRET_KEY: urrad240vzlws0303okqarsaj3909lykq5mbfteccejw5yvcsj
NAUTOBOT_SUPERUSER_API_TOKEN: gpi5ukyfi291a1en8d5tk6tgxppg5ycysi3z22ew
NAUTOBOT_SUPERUSER_EMAIL: ""
NAUTOBOT_SUPERUSER_NAME: admin
NAUTOBOT_SUPERUSER_PASSWORD: ajlab.local
PGPASSWORD: ajlab.local
POSTGRES_DB: nautobot
POSTGRES_PASSWORD: ajlab.local
POSTGRES_USER: nautobot
healthcheck:
test:
- CMD
- nautobot-server
- health_check
timeout: 10s
interval: 10s
retries: 3
start_period: 3m0s
image: nautobot
networks:
default: null
restart: unless-stopped
volumes:
- type: bind
source: /home/nautobot/nautobot-docker-compose/nautobot_config.py
target: /opt/nautobot/nautobot_config.py
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/transposer.py
target: /usr/local/lib/python3.9/transposer.py
bind:
create_host_path: true
network_importer:
depends_on:
batfish:
condition: service_started
environment:
MARIADB_DATABASE: nautobot
MARIADB_PASSWORD: ajlab.local
MARIADB_ROOT_PASSWORD: ajlab.local
MARIADB_USER: nautobot
NAUTOBOT_ALLOWED_HOSTS: localhost,nginx,nautobot.ajlab.local,192.168.254.20
NAUTOBOT_CACHEOPS_REDIS: redis://:ajlab.local@redis:6379/1
NAUTOBOT_CHANGELOG_RETENTION: "0"
NAUTOBOT_CONFIG: /opt/nautobot/nautobot_config.py
NAUTOBOT_CREATE_SUPERUSER: "true"
NAUTOBOT_DB_HOST: db
NAUTOBOT_DB_NAME: nautobot
NAUTOBOT_DB_PASSWORD: ajlab.local
NAUTOBOT_DB_USER: nautobot
NAUTOBOT_HIDE_RESTRICTED_UI: "True"
NAUTOBOT_LOG_LEVEL: WARNING
NAUTOBOT_MAX_PAGE_SIZE: "0"
NAUTOBOT_NAPALM_PASSWORD: ajlab.local
NAUTOBOT_NAPALM_TIMEOUT: "30"
NAUTOBOT_NAPALM_USERNAME: admin
NAUTOBOT_REDIS_HOST: redis
NAUTOBOT_REDIS_PASSWORD: ajlab.local
NAUTOBOT_REDIS_PORT: "6379"
NAUTOBOT_SECRET_KEY: urrad240vzlws0303okqarsaj3909lykq5mbfteccejw5yvcsj
NAUTOBOT_SUPERUSER_API_TOKEN: gpi5ukyfi291a1en8d5tk6tgxppg5ycysi3z22ew
NAUTOBOT_SUPERUSER_EMAIL: ""
NAUTOBOT_SUPERUSER_NAME: admin
NAUTOBOT_SUPERUSER_PASSWORD: ajlab.local
PGPASSWORD: ajlab.local
POSTGRES_DB: nautobot
POSTGRES_PASSWORD: ajlab.local
POSTGRES_USER: nautobot
image: network-importer
networks:
default: null
restart: unless-stopped
stdin_open: true
tty: true
volumes:
- type: bind
source: /home/nautobot/nautobot-docker-compose/network-importer/network_importer.toml
target: /local/network_importer.toml
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/nginx/nginx.crt
target: /usr/local/share/ca-certificates/nginx.crt
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/network-importer/arista_eos.py
target: /local/network_importer/drivers/arista_eos.py
bind:
create_host_path: true
nginx:
depends_on:
nautobot:
condition: service_started
environment:
MARIADB_DATABASE: nautobot
MARIADB_PASSWORD: ajlab.local
MARIADB_ROOT_PASSWORD: ajlab.local
MARIADB_USER: nautobot
NAUTOBOT_ALLOWED_HOSTS: localhost,nginx,nautobot.ajlab.local,192.168.254.20
NAUTOBOT_CACHEOPS_REDIS: redis://:ajlab.local@redis:6379/1
NAUTOBOT_CHANGELOG_RETENTION: "0"
NAUTOBOT_CONFIG: /opt/nautobot/nautobot_config.py
NAUTOBOT_CREATE_SUPERUSER: "true"
NAUTOBOT_DB_HOST: db
NAUTOBOT_DB_NAME: nautobot
NAUTOBOT_DB_PASSWORD: ajlab.local
NAUTOBOT_DB_USER: nautobot
NAUTOBOT_HIDE_RESTRICTED_UI: "True"
NAUTOBOT_LOG_LEVEL: WARNING
NAUTOBOT_MAX_PAGE_SIZE: "0"
NAUTOBOT_NAPALM_PASSWORD: ajlab.local
NAUTOBOT_NAPALM_TIMEOUT: "30"
NAUTOBOT_NAPALM_USERNAME: admin
NAUTOBOT_REDIS_HOST: redis
NAUTOBOT_REDIS_PASSWORD: ajlab.local
NAUTOBOT_REDIS_PORT: "6379"
NAUTOBOT_SECRET_KEY: urrad240vzlws0303okqarsaj3909lykq5mbfteccejw5yvcsj
NAUTOBOT_SUPERUSER_API_TOKEN: gpi5ukyfi291a1en8d5tk6tgxppg5ycysi3z22ew
NAUTOBOT_SUPERUSER_EMAIL: ""
NAUTOBOT_SUPERUSER_NAME: admin
NAUTOBOT_SUPERUSER_PASSWORD: ajlab.local
PGPASSWORD: ajlab.local
POSTGRES_DB: nautobot
POSTGRES_PASSWORD: ajlab.local
POSTGRES_USER: nautobot
image: nginx:1.23.1
networks:
default: null
ports:
- mode: ingress
target: 80
published: "80"
protocol: tcp
- mode: ingress
target: 443
published: "443"
protocol: tcp
restart: unless-stopped
volumes:
- type: bind
source: /home/nautobot/nautobot-docker-compose/nginx.key
target: /etc/ssl/private/nginx.key
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/nginx.crt
target: /etc/ssl/certs/nginx.crt
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/nginx.conf
target: /etc/nginx/conf.d/nginx.conf
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/nautobot.crt
target: /usr/local/share/ca-certificates/nautobot.crt
bind:
create_host_path: true
redis:
command:
- sh
- -c
- redis-server --appendonly yes --requirepass $$NAUTOBOT_REDIS_PASSWORD
environment:
MARIADB_DATABASE: nautobot
MARIADB_PASSWORD: ajlab.local
MARIADB_ROOT_PASSWORD: ajlab.local
MARIADB_USER: nautobot
NAUTOBOT_ALLOWED_HOSTS: localhost,nginx,nautobot.ajlab.local,192.168.254.20
NAUTOBOT_CACHEOPS_REDIS: redis://:ajlab.local@redis:6379/1
NAUTOBOT_CHANGELOG_RETENTION: "0"
NAUTOBOT_CONFIG: /opt/nautobot/nautobot_config.py
NAUTOBOT_CREATE_SUPERUSER: "true"
NAUTOBOT_DB_HOST: db
NAUTOBOT_DB_NAME: nautobot
NAUTOBOT_DB_PASSWORD: ajlab.local
NAUTOBOT_DB_USER: nautobot
NAUTOBOT_HIDE_RESTRICTED_UI: "True"
NAUTOBOT_LOG_LEVEL: WARNING
NAUTOBOT_MAX_PAGE_SIZE: "0"
NAUTOBOT_NAPALM_PASSWORD: ajlab.local
NAUTOBOT_NAPALM_TIMEOUT: "30"
NAUTOBOT_NAPALM_USERNAME: admin
NAUTOBOT_REDIS_HOST: redis
NAUTOBOT_REDIS_PASSWORD: ajlab.local
NAUTOBOT_REDIS_PORT: "6379"
NAUTOBOT_SECRET_KEY: urrad240vzlws0303okqarsaj3909lykq5mbfteccejw5yvcsj
NAUTOBOT_SUPERUSER_API_TOKEN: gpi5ukyfi291a1en8d5tk6tgxppg5ycysi3z22ew
NAUTOBOT_SUPERUSER_EMAIL: ""
NAUTOBOT_SUPERUSER_NAME: admin
NAUTOBOT_SUPERUSER_PASSWORD: ajlab.local
PGPASSWORD: ajlab.local
POSTGRES_DB: nautobot
POSTGRES_PASSWORD: ajlab.local
POSTGRES_USER: nautobot
image: redis:alpine
networks:
default: null
restart: unless-stopped
networks:
default:
name: nautobot-docker-compose_default
volumes:
db_data:
name: nautobot-docker-compose_db_data
ajcruz
(AJ Cruz)
November 24, 2022, 5:38pm
10
And correct, docker-ce (as far as I know) on Ubuntu 22.04.1:
nautobot@nautobot:~$ docker version
Client: Docker Engine - Community
Version: 20.10.21
API version: 1.41
Go version: go1.18.7
Git commit: baeda1f
Built: Tue Oct 25 18:01:58 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.21
API version: 1.41 (minimum version 1.12)
Go version: go1.18.7
Git commit: 3056208
Built: Tue Oct 25 17:59:49 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.9
GitCommit: 1c90a442489720eec95342e1789ee8a5e1b9536f
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
nautobot@nautobot:~$ docker compose version
Docker Compose version v2.12.2
For some reason the forum spam filters really hate me, keep hiding my posts even on new replies. I think I made them angry editing a post several times too quickly.
ajcruz
(AJ Cruz)
November 24, 2022, 5:41pm
11
Lemme try this again since the spam filter killed it the first time, dunno if it was the size, I’ll try to post just the one container from the docker compose config command:
nautobot:
environment:
MARIADB_DATABASE: nautobot
MARIADB_PASSWORD: ajlab.local
MARIADB_ROOT_PASSWORD: ajlab.local
MARIADB_USER: nautobot
NAUTOBOT_ALLOWED_HOSTS: localhost,nginx,nautobot.ajlab.local,192.168.254.20
NAUTOBOT_CACHEOPS_REDIS: redis://:ajlab.local@redis:6379/1
NAUTOBOT_CHANGELOG_RETENTION: "0"
NAUTOBOT_CONFIG: /opt/nautobot/nautobot_config.py
NAUTOBOT_CREATE_SUPERUSER: "true"
NAUTOBOT_DB_HOST: db
NAUTOBOT_DB_NAME: nautobot
NAUTOBOT_DB_PASSWORD: ajlab.local
NAUTOBOT_DB_USER: nautobot
NAUTOBOT_HIDE_RESTRICTED_UI: "True"
NAUTOBOT_LOG_LEVEL: WARNING
NAUTOBOT_MAX_PAGE_SIZE: "0"
NAUTOBOT_NAPALM_PASSWORD: ajlab.local
NAUTOBOT_NAPALM_TIMEOUT: "30"
NAUTOBOT_NAPALM_USERNAME: admin
NAUTOBOT_REDIS_HOST: redis
NAUTOBOT_REDIS_PASSWORD: ajlab.local
NAUTOBOT_REDIS_PORT: "6379"
NAUTOBOT_SECRET_KEY: urrad240vzlws0303okqarsaj3909lykq5mbfteccejw5yvcsj
NAUTOBOT_SUPERUSER_API_TOKEN: gpi5ukyfi291a1en8d5tk6tgxppg5ycysi3z22ew
NAUTOBOT_SUPERUSER_EMAIL: ""
NAUTOBOT_SUPERUSER_NAME: admin
NAUTOBOT_SUPERUSER_PASSWORD: ajlab.local
PGPASSWORD: ajlab.local
POSTGRES_DB: nautobot
POSTGRES_PASSWORD: ajlab.local
POSTGRES_USER: nautobot
image: nautobot
networks:
default: null
ports:
- mode: ingress
target: 8443
published: "8443"
protocol: tcp
restart: unless-stopped
volumes:
- type: bind
source: /home/nautobot/nautobot-docker-compose/nautobot_config.py
target: /opt/nautobot/nautobot_config.py
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/nautobot.key
target: /opt/nautobot/nautobot.key
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/nautobot.crt
target: /opt/nautobot/nautobot.crt
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/uwsgi.ini
target: /opt/nautobot/uwsgi.ini
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/transposer.py
target: /usr/local/lib/python3.9/transposer.py
bind:
create_host_path: true
- type: bind
source: /home/nautobot/nautobot-docker-compose/softwarelist.py
target: /opt/nautobot/jobs/softwarelist.py
bind:
create_host_path: true
ajcruz
(AJ Cruz)
November 24, 2022, 5:43pm
12
For some reason the spam filter is killing it even when I strip out most of it to just show the container.
Here’s what the volume command looks like from the docker compose config command:
- type: bind
source: /home/nautobot/nautobot-docker-compose/transposer.py
target: /usr/local/lib/python3.9/transposer.py
bind:
create_host_path: true
ajcruz
(AJ Cruz)
November 24, 2022, 5:44pm
13
and no worries on the time, no rush, I appreciate you
meyay
(Metin Y.)
November 24, 2022, 6:46pm
14
I generate the combined compose file myself and the configuration seems fine and gives no clue to why the jobs folder would have an unexpected owner.
I can not reproduce the issue. I tried an image which has an application inside a user owned folder. I created a container using that image and bind a single file into that user owned folder. As a result the bind mounted file has the same permissions as on the host, and the folder itself has still the owner UID/GID as declared in the image.
ajcruz
(AJ Cruz)
November 24, 2022, 7:10pm
15
Thanks for testing that, baffling.
ajcruz
(AJ Cruz)
November 24, 2022, 7:20pm
16
For the fun of it I even tried to add this as the volume:
- type: bind
source: /home/nautobot/nautobot-docker-compose/softwarelist.py
target: /opt/nautobot/jobs/softwarelist.py
bind:
create_host_path: False
I get the same results, container starts with jobs folder re-created and set to root owner
meyay
(Metin Y.)
November 24, 2022, 7:48pm
17
Wheneven things don’t add up, it’s usually a good idea to check whether the snap package or parts of another docker installation exists on the system:
snap list docker
dpkg -l | grep docker
ajcruz
(AJ Cruz)
November 24, 2022, 7:52pm
18
I think it might be coming from the application. I asked in their slack channel if the Nautobot server could be modifying the jobs folder when creating the app with Docker Compose and here’s what I got:
" It’s not explicitly modifying the permissions, but if when you run nautobot-server init
(as is done by the Docker image on build), and the jobs
directory (as defined by JOBS_ROOT
) does not exist, it will be created for you. So in this case it appears it is being created by root and isn’t desirable if you don’t have the mount in place."
As a workaround I created a jobs folder on my host with init and my python job and then changed my volume to:
- /home/nautobot/nautobot-docker-compose/jobs:/opt/nautobot/jobs
And it’s all working now.
1 Like
I’m not sure why the first reply is marked as an answer, when you say that wasn’t the case, but I’m pretty sure the problem is that you’re mounting a file rather than a folder. You can’t really mount an individual file, it mounts the folder above it. I’ve had no end of trouble with this!
meyay
(Metin Y.)
November 29, 2022, 1:36pm
20
You are not using Docker-CE, are you? Your observation makes sense with Docker Desktop, which always runs the docker engine in a vm (regardless whether Windows, Mac or Linux), which does not allow to bind single files from the host to a container.