Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Docker daemon general log extra parameters.

Featured Replies

Hi friends, I'd like to pass extra log parameters for all my docker containers.

 

--log-driver json-file --log-opt tag="{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}"

 

I know I can use "extra parameters" session for every container, but I'd like to do this in a global way.

 

I tried creating a /etc/docker/daemon.json with these parms but when I started docker I got

unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: log-opts: (from flag: map[max-file:1 max-size:50m], from file: map[tag:{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}])

 

I couldn't find a way to do this in unraid > settings > docker tab.

 

Does anyone can help me with this?

 

Edited by jairbj

  • 2 weeks later...
On 8/9/2021 at 3:59 PM, jairbj said:

tried creating a /etc/docker/daemon.json with these parms

How does your json look like?

 

On 8/9/2021 at 3:59 PM, jairbj said:
the following directives are specified both as a flag and in the configuration file

Maybe this happens because --log-opt is already defined in /etc/rc.d/rc.docker?!

# Enable global docker LOG rotation
if [[ $DOCKER_LOG_ROTATION == yes ]]; then
  [[ -z $DOCKER_LOG_SIZE ]] && DOCKER_LOG_SIZE=10m
  [[ -z $DOCKER_LOG_FILES ]] && DOCKER_LOG_FILES=1
  DOCKER_OPTS="--log-opt max-size=$DOCKER_LOG_SIZE --log-opt max-file=$DOCKER_LOG_FILES $DOCKER_OPTS"
fi

...

    nohup $UNSHARE --propagation slave -- $DOCKER -p $DOCKER_PIDFILE $DOCKER_OPTS >>$DOCKER_LOG 2>&1 &

 

Try to edit this file. If this works, you could try to overwrite it through your Go file and "sed", so its permanent on reboot.

  • Author
19 hours ago, mgutt said:

How does your json look like?

 

Maybe this happens because --log-opt is already defined in /etc/rc.d/rc.docker?!

# Enable global docker LOG rotation
if [[ $DOCKER_LOG_ROTATION == yes ]]; then
  [[ -z $DOCKER_LOG_SIZE ]] && DOCKER_LOG_SIZE=10m
  [[ -z $DOCKER_LOG_FILES ]] && DOCKER_LOG_FILES=1
  DOCKER_OPTS="--log-opt max-size=$DOCKER_LOG_SIZE --log-opt max-file=$DOCKER_LOG_FILES $DOCKER_OPTS"
fi

...

    nohup $UNSHARE --propagation slave -- $DOCKER -p $DOCKER_PIDFILE $DOCKER_OPTS >>$DOCKER_LOG 2>&1 &

 

Try to edit this file. If this works, you could try to overwrite it through your Go file and "sed", so its permanent on reboot.

 

Hi friend. Thank you for the TIP, solved it adding this to my GO file:

 

sed -i '2 i DOCKER_OPTS="$DOCKER_OPTS --log-driver json-file --log-opt tag=\\\"{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}\\\""' /etc/rc.d/rc.docker

 

Although it works, @limetech promised to add an "additional options" at docker settings page here. I couldn't find this option.

  • 1 year later...
On 8/20/2021 at 8:37 PM, jairbj said:

 

Hi friend. Thank you for the TIP, solved it adding this to my GO file:

 

sed -i '2 i DOCKER_OPTS="$DOCKER_OPTS --log-driver json-file --log-opt tag=\\\"{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}\\\""' /etc/rc.d/rc.docker

 

Although it works, @limetech promised to add an "additional options" at docker settings page here. I couldn't find this option.

was this ever added?

  • 2 weeks later...

Not till now as I know. At least not in docker settings page on version: 6.11.5.

  • 1 month later...

I see these is a file in /boot/config/docker.cfg where you can add $DOCKER_OPTS variable to contain the extra params for docker.
I have this in my  `/boot/config/docker.cfg`:

DD_TAG="{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}"
DOCKER_OPTS="$DOCKER_OPTS --log-opt tag=$DD_TAG"

 

You will need to restart docker service via settings->docker

Edited by Saad

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.