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.

Starting Docker Containers in Set Order

Featured Replies

Hi All - I'm working on a script that involves stopping and then starting all docker containers. I have it working, but the containers start in some default order and not the top-down order I have them set in the Docker tab. Is there a way to have them start according to the order and delay settings in the Docker tab? Or does the script just need to start them individually in the desired order?

 

Thanks in advance,

 

Eric

  • Author

Figured it out partially on my own. The order set on the Docker tab seems to be stored in /boot/config/plugins/dockerMan/userprefs.cfg, each line having a container name in quotes. The script below goes through the config line by line and does a docker start on whatever is contained within the quotes, with a 30 second wait between each container. Ideally it should only wait the amount of time set for each container on the Docker tab, but I haven't found where those values are stored yet.

 

#!/bin/bash

# Specify the path to your .cfg file
CFG_FILE="/boot/config/plugins/dockerMan/userprefs.cfg"

# Check if the file exists
if [ ! -f "$CFG_FILE" ]; then
    echo "Error: Config file not found."
    exit 1
fi

# Read the .cfg file line by line and start Docker containers
while IFS= read -r line
do
    # Extract container name within quotes
    container_name=$(echo "$line" | sed -n 's/.*"\(.*\)".*/\1/p')

    # Start Docker container
    docker start "$container_name"

    # Check the exit status
    if [ $? -eq 0 ]; then
        echo "Container '$container_name' started successfully. Waiting to start next Container."
        sleep 30 # Wait for 30 seconds before starting the next container
    else
        echo "Error: Failed to start container '$container_name'."
    fi
done < "$CFG_FILE"

echo "All containers started."

 

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.