Docker Community Forums

Share and learn in the Docker community.

Docker error parsing config {error 21] is a directory config.config.yml

Hi I am unable to create a container due to the error

` * Starting nginx nginx,
…done.,
Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,

  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’,
  • Starting nginx nginx,
    …done.,
    Error parsing config: [Errno 21] Is a directory: ‘/config/config.yml’`

I have installed Docker and Portainer , however the config.yml file is on my Mac whereas the host for the docker container i Proxmox on a headless mini pc . How can i get the config file to from the MAC to the Container?

Any advice would be appreciated as i am a newbie to docker. Thanks in advance

The error message indicates that you mapped a directory into the container path /config/config.yml. Either you need to map a host file into a container file (I am not even sure if this is possible on Docker for Desktop) or even better map a host directory into a container directory.

Hi I realised and understood the error i have now changed them around and now i have a different error
Error parsing config: [Errno 2] No such file or directory: ‘/config/config.yml’ ??? I have created a config file thru nano in the container , however i am unsure how to mount it. If I create a directory for the file i will receive the error again as it is a directory ??

So confusing.

Don’t you think it’s time to share details about how you create the container?

I created the docker container in Proxmox lxc. Ubuntu 21.04 privileged and Nesting 1, with portainer. I run the docker-compose and config.yml

detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu

mqtt:
  host: 192.168.0.74
  user: mikey
  password: mqtt6283

cameras:
  # Reolink
  garage_driveway:
    ffmpeg:
      inputs:
        - path: rtsp://admin:Garage1@192.168.0.51:554/h264Preview_01_sub
        - roles:
            - detect
            - clips
    #  motion:
    #    mask:
    width: 640
    height: 480
    fps: 5
    objects:
      track:
        - person
    snapshots:
      enabled: true
      timestamp: false
      bounding_box: true
      retain:
        default: 1
    clips:
      enabled:
      retain:
        default: 1

version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: blakeblackshear/frigate:stable-amd64
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /mnt/data/frigate/config.yml:/config/config.yml:ro
      - /users/mike/frigate_media:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - 5000:5000
      - "1935:1935" # RTMP feeds
    environment:
      FRIGATE_RTSP_PASSWORD: "password"

As a newbie i hope that this help and i look forward to your comments.

The error message indicates that /mnt/data/frigate/config.yml is a folder and not a file. Even though your container side of the volume mount looks like a file, docker mounts host folders into container folders - in your case a folder that happens to have a name that looks like a file name. Nginx on the other hand expects a file, not a folder. If you want a bind-mount volume to map a file from the host to the container, you have to specify a file on the host side of the mapping - apparently this is what you want to do, but don’t do.

Since /mnt/date/frigate seems to be a mountpoint that mounts a remote share, you will always end up with trouble. As mount propagation will be an issue: what the mounted remote share becomes available/unavailable/stale while the container is running?

You will either want to copy the config file to the docker host - or build your own image, where you copy the config file into the image and make it a fixed part of the resulting image.