go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

How to Add Configuration Parameters When Starting a Docker Container

Open yhxiaoh opened this issue 1 year ago • 2 comments

How can I add configuration parameters when starting a Docker container, similar to go2rtc -c log.format=text -c rtsp.listen=''? If possible, could you provide the complete docker run command? Looking forward to your reply

yhxiaoh avatar Oct 18 '24 09:10 yhxiaoh

This is a general question about docker usage. Not directly related to this project. You need to read the docker documentation.

AlexxIT avatar Oct 18 '24 09:10 AlexxIT

Here's how I'm doing it in my docker-compose.yml file, in order to avoid a bind mount for the config file, so that I can throw it into docker swarm:

services:
  go2rtc:
    image: art.t3.daimlertruck.com/godap-docker-virtual/alexxit/go2rtc:latest
    privileged: true
    environment:
      - TZ=America/Los_Angeles
#    network_mode: host
    ports:
      - 1984:1984
      - 8554:8554
      - 8555:8555
#    volumes:
#      - "./go2rtc.yaml:/config/go2rtc.yaml"
# Info on constructing the command statement instead of using
# the go2rtc.yaml config file and bind mount can be found here
# https://github.com/AlexxIT/go2rtc/blob/master/internal/app/README.md
    command: >
      go2rtc 
        -config api.origin="'*'"
        -config streams.bambu_x1e='rtsps://${X1E_USR}:${X1E_ACCESS_CODE}@${X1E_IP_ADDR}/streaming/live/1'
        -config log.level='debug'
        -config log.format='text'

RagingRoosevelt avatar Nov 07 '24 20:11 RagingRoosevelt