Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

permission issue with docker compose up #688

Open
zydisney opened this issue Apr 2, 2024 · 6 comments
Open

permission issue with docker compose up #688

zydisney opened this issue Apr 2, 2024 · 6 comments

Comments

@zydisney
Copy link

zydisney commented Apr 2, 2024

nats-1           | nats-server: read /config/gnatsd.conf: is a directory
nats-1           | nats-server: read /config/gnatsd.conf: is a directory
nats-1           | nats-server: read /config/gnatsd.conf: is a directory
spreedbackend-1  | Preparing signaling server configuration in /config/server.conf ...
spreedbackend-1  | cp: can't create '/config/server.conf/server.conf.in': Permission denied
spreedbackend-1  | Preparing signaling server configuration in /config/server.conf ...
spreedbackend-1  | cp: can't create '/config/server.conf/server.conf.in': Permission denied

I got this issue when use sudo docker compose up to start the container. How should I fix it?

@klatka
Copy link

klatka commented Apr 6, 2024

  1. remove dirs docker/server.conf and docker/gnatsd.conf
  2. copy server.conf and gnatsd.conf into docker/

@zydisney
Copy link
Author

zydisney commented Apr 6, 2024

  1. remove dirs docker/server.conf and docker/gnatsd.conf
  2. copy server.conf and gnatsd.conf into docker/

I copy server.conf and gnatsd.conf (which are files) to docker/
The new error appears. It seems require gnatsd.conf to be a folder.

Error response from daemon: failed to create task for container: failed to create shim task: 
OCI runtime create failed: runc create failed: unable to start container process: error during container init: 
error mounting "/home/aaron/nextcloud-spreed-signaling/docker/gnatsd.conf" to rootfs at "/config/gnatsd.conf": mount /home/aaron/nextcloud-spreed-signaling/docker/gnatsd.conf:/config/gnatsd.conf (via /proc/self/fd/6), 
flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? 
Check if the specified host path exists and is the expected type

If I don't copy gnatsd.conf to docker/, docker compose up will create a gnatsd.conf dir. After that, error:

nats-1           | nats-server: read /config/gnatsd.conf: is a directory 

@fancycode
Copy link
Member

Which OS / version of Docker is this? The steps described by @klatka should work fine, just tested this here myself.

@Waldhonig01
Copy link

Hello everyone,

I'm facing the same problem and have already tried everything possible. Every time if i start “docker compose up” a folder is created instead of a file.
I am using Docker Compose version v2.29.1 on Ubuntu 22.04.4 LTS
Have everyone an idea ?

@Chrysocyon1
Copy link

Chrysocyon1 commented Nov 12, 2024

Hi,

I had this issue because my docker compose was lower than the version mentioned here.
https://github.com/strukturag/nextcloud-spreed-signaling/blob/master/README.md#docker-compose

Please note that docker-compose v2 is required for building while most distributions will ship older versions.
You can download a recent version from https://docs.docker.com/compose/install/

Docker and docker-compose are different tools. I checked my docker compose version with docker compose version .

@rodinux
Copy link

rodinux commented Dec 18, 2024

Hello, I have also something I can't resolve... the container nats does not seem have a gnatsd.conf...

I have tried few times run it with the command command: ["-c", "/config/gnatsd.conf"] it did'nt seems working, so I used the old one command: ["-c", "nats-server.conf"]

I tried also without mounting the file, the only file I could see is nats-server.conf, mounting the file I could do a docker cp -a docker-nats-1 nats-server.conf . before so I have got a filenats-server.conf`.

I have put the files in another directory /etc/signaling/ So with last version with nats:2.10 it works for me do this

services:

  spreedbackend:
    build:
      context: ..
      dockerfile: docker/server/Dockerfile
#      platforms:
#        - "linux/amd64"
    volumes:
      - /etc/signaling/server.conf:/config/server.conf:ro
    environment:
#      CONFIG: '/etc/signaling/server.conf'
      HTTP_LISTEN: 127.0.0.1:8080
      HTTPS_LISTEN: 127.0.0.1:8443
      HTTPS_CERTIFICATE: /etc/letsencrypt/live/domain-spreed-signaling.tld/fullchain.pem
      HTTPS_KEY: /etc/letsencrypt/live/domain-spreed-signaling.tld/privkey.pem
      HASH_KEY: xxxxxxxxxxxxxxxxxxxxxxxx
      BLOCK_KEY: xxxxxxxxxxxxxxxxxxxxxxx
      BACKENDS: backend-1,backend-2,backend-3
      BACKEND_BACKEND-1_URL: https://nextcloud1.tld
      BACKEND_BACKEND-1_SHARED_SECRET: xxxxxxxxxxxxxxxxxxxxxxx
      BACKEND_BACKEND-2_URL: https://nextcloud2.tld
      BACKEND_BACKEND-2_SHARED_SECRET: xxxxxxxxxxxxxxxxxxxxxxxxx
      BACKEND_BACKEND-3_URL: https://nextcloud3-tld
      BACKEND_BACKEND-3_SHARED_SECRET: xxxxxxxxxxxxxxxxxxxxx
      USE_JANUS: 1
      JANUS_URL: ws://localhost:8188
      TURN_API_KEY: xxxxxxxxxxxxxxxxxxxxx
      TURN_SECRET: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      TURN_SERVERS: turn:localhost:3478?transport=udp,turn:localhost:3478?transport=tcp
    network_mode: host
    restart: unless-stopped
    depends_on:
      - nats
      - janus
      - coturn

  nats:
    image: nats:2.10
    volumes:
      - type: bind
        source: /etc/signaling/nats-server.conf
        target: /config/nats-server.conf
        read_only: true
    command: ["-c", "nats-server.conf"]
    network_mode: host
    restart: unless-stopped
#  nats:
#    image: nats:2.9.25
#    command: ["-c", "nats-server.conf"]
#    network_mode: host
#    restart: unless-stopped

  janus:
    build: janus
    command: ["janus", "--full-trickle"]
    volumes:
      - /etc/signaling/janus:/usr/local/etc/janus
    network_mode: host
    restart: unless-stopped

  coturn:
    image: coturn/coturn:4.6
    network_mode: host
    ## Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the gnatsd docker image to create one to an existing server.
  routes = []
}

    # Update command parameters as necessary.
    #
    # See https://github.com/coturn/coturn/blob/master/README.turnserver for
    # available options.
    command:
      - "--realm"
      - "domain-spreed-signaling.tld"
      - "--static-auth-secret"
      - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      - "--no-stdout-log"
      - "--log-file"
      - "stdout"
      - "--stale-nonce=600"
      - "--use-auth-secret"
      - "--lt-cred-mech"
      - "--fingerprint"
      - "--no-software-attribute"
      - "--no-multicast-peers"
    restart: unless-stopped

Do I have something wrong ??

Here my docker version

docker version
Client: Docker Engine - Community
 Version:           27.1.1
 API version:       1.46
 Go version:        go1.21.12
 Git commit:        6312585
 Built:             Tue Jul 23 19:57:19 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.1.1
  API version:      1.46 (minimum version 1.24)
  Go version:       go1.21.12
  Git commit:       cc13f95
  Built:            Tue Jul 23 19:57:19 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.19
  GitCommit:        2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc:
  Version:          1.7.19
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

and the file /etc/signaling/nats-server.conf

# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:xxxxxxxx@otherdockerhost:6222
  authorization {
    user: ruser
    password: xxxxxxxxx
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the gnatsd docker image to create one to an existing server.
  routes = []
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants