canyanio / janus-gateway-docker

Docker image for the Janus WebRTC Server
Other
160 stars 64 forks source link

Error when running docker-compose up #8

Open abishekrsrikaanth opened 3 years ago

abishekrsrikaanth commented 3 years ago

I get the following error when I run docker-compose up.

Creating network "janus_default" with the default driver
Creating janus_janus-gateway_1 ... error

ERROR: for janus_janus-gateway_1  Cannot start service janus-gateway: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/Users/abisheksrikaanth/projects/janus/etc/janus/janus.jcfg\\\" to rootfs \\\"/var/lib/docker/overlay2/55ac8c94564eb9f452cf24add575444d7e92676c900bc183b3576bc97c04d137/merged\\\" at \\\"/var/lib/docker/overlay2/55ac8c94564eb9f452cf24add575444d7e92676c900bc183b3576bc97c04d137/merged/usr/local/etc/janus/janus.jcfg\\\" caused \\\"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

ERROR: for janus-gateway  Cannot start service janus-gateway: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/Users/abisheksrikaanth/projects/janus/etc/janus/janus.jcfg\\\" to rootfs \\\"/var/lib/docker/overlay2/55ac8c94564eb9f452cf24add575444d7e92676c900bc183b3576bc97c04d137/merged\\\" at \\\"/var/lib/docker/overlay2/55ac8c94564eb9f452cf24add575444d7e92676c900bc183b3576bc97c04d137/merged/usr/local/etc/janus/janus.jcfg\\\" caused \\\"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
ERROR: Encountered errors while bringing up the project.

Here is the contents of my docker-compose.yml

version: '2.1'
services:

  #
  # janus-gateway
  #
  janus-gateway:
    image: 'canyan/janus-gateway:latest'
    command: [ "/usr/local/bin/janus", "-F", "/usr/local/etc/janus" ]
    ports:
      - "8088:8088"
      - "8089:8089"
      - "8889:8889"
      - "8000:8000"
      - "7088:7088"
      - "7089:7089"
    volumes:
      - "./etc/janus/janus.jcfg:/usr/local/etc/janus/janus.jcfg"
      - "./etc/janus/janus.eventhandler.sampleevh.jcfg:/usr/local/etc/janus/janus.eventhandler.sampleevh.jcfg"
    restart: always

Am I missing something?

tranchitella commented 3 years ago

@abishekrsrikaanth are you sure the following paths, relative to the current path of your docker-compose.yaml files, are files?

iwin4aids commented 3 years ago

@abishekrsrikaanth are you sure the following paths, relative to the current path of your docker-compose.yaml files, are files?

  • etc/janus/janus.jcfg
  • etc/janus/janus.eventhandler.sampleevh.jcfg

but how to configure these jcfg files ? any docs ?

tranchitella commented 3 years ago

@abishekrsrikaanth are you sure the following paths, relative to the current path of your docker-compose.yaml files, are files?

  • etc/janus/janus.jcfg
  • etc/janus/janus.eventhandler.sampleevh.jcfg

but how to configure these jcfg files ? any docs ?

Please refer to upstream documentation, we only provide the Docker image. For your preliminary testing, please omit the volume mounts in your docker-compose to start Janus with the default configuration.

makidoll commented 3 years ago

I don't know if this helps but OCI runtime create failed always happens for me when I update my Linux kernel and haven't restarted my machine yet.

ajaxsys commented 3 years ago

Tried sample config files from https://github.com/meetecho/janus-gateway/tree/master/conf

but got errors:

janus-gateway_1 | [FATAL] [janus.c:main:5115] Couldn't access plugins folder...

And remove volumes mapping seems no error, but what about next? Tried access all ports form browser but nothing.

As a beginner I just try to run and see what happen.

pleymor commented 3 years ago

Exact same issues.

For the first, instead of just removing the volumes, I changed docker-compose version (check which one is supported by your docker machine).

version: '3.8'
services:

  #
  # janus-gateway
  #
  janus-gateway:
    image: 'canyan/janus-gateway:latest'
    command: ["/usr/local/bin/janus", "-F", "/usr/local/etc/janus"]
    ports:
      - "8088:8088"
      - "8089:8089"
      - "8889:8889"
      - "8000:8000"
      - "7088:7088"
      - "7089:7089"
    volumes:
      - "./etc/janus/janus.jcfg:/usr/local/etc/janus/janus.jcfg"
      - "./etc/janus/janus.eventhandler.sampleevh.jcfg:/usr/local/etc/janus/janus.eventhandler.sampleevh.jcfg"
    restart: always

For the FATAL: I solved it by copying the janus.jcfg janus.eventhandler.sampleevh.jcfg files from the official sample here to ./etc/janus (remove the extension .sample)

Then edit ./etc/janus/janus.jcfg this way:

general: {
    configs_folder = "/usr/local/etc/janus"         # Configuration files folder
    plugins_folder = "/usr/local/lib/janus/plugins"         # Plugins folder
    transports_folder = "/usr/local/lib/janus/transports"   # Transports folder
    events_folder = "/usr/local/lib/janus/events"           # Event handlers folder
    loggers_folder = "/usr/local/lib/janus/loggers"         # External loggers folder

Then docker-compose up -d

Worked for me ^^

hotsmile commented 1 year ago

Exact same issues.

For the first, instead of just removing the volumes, I changed docker-compose version (check which one is supported by your docker machine).

version: '3.8'
services:

  #
  # janus-gateway
  #
  janus-gateway:
    image: 'canyan/janus-gateway:latest'
    command: ["/usr/local/bin/janus", "-F", "/usr/local/etc/janus"]
    ports:
      - "8088:8088"
      - "8089:8089"
      - "8889:8889"
      - "8000:8000"
      - "7088:7088"
      - "7089:7089"
    volumes:
      - "./etc/janus/janus.jcfg:/usr/local/etc/janus/janus.jcfg"
      - "./etc/janus/janus.eventhandler.sampleevh.jcfg:/usr/local/etc/janus/janus.eventhandler.sampleevh.jcfg"
    restart: always

For the FATAL: I solved it by copying the janus.jcfg janus.eventhandler.sampleevh.jcfg files from the official sample here to ./etc/janus (remove the extension .sample)

Then edit ./etc/janus/janus.jcfg this way:

general: {
  configs_folder = "/usr/local/etc/janus"         # Configuration files folder
  plugins_folder = "/usr/local/lib/janus/plugins"         # Plugins folder
  transports_folder = "/usr/local/lib/janus/transports"   # Transports folder
  events_folder = "/usr/local/lib/janus/events"           # Event handlers folder
  loggers_folder = "/usr/local/lib/janus/loggers"         # External loggers folder

Then docker-compose up -d

Worked for me ^^

how to access http service , when i use your cfg file, but i can't access the janus http service, please help me ,thks