Marolo Posted October 9, 2022 Share Posted October 9, 2022 (edited) Hello, I would like Docker Engine to start only after starting VM (PFSense). I downloaded Script from the Internet and I know when Pfsense is ready: #!/bin/bash printf "MT - %s" "czekam na uruchomienie pfSense ..." while ! ping -c 1 -n -w 1 192.168.1.1 &> /dev/null do printf "%c" "." done printf "\n%s\n" "MT - pfSense jest już online" How to start Docker Engine now, just like using the Settings -> Docker -> Enabled Docker = Yes Pfsense assigns me an IP in my network in 192.168.1.0, and the first pool is reserved for Docker containers. Now, when Unraid restart, the docker containers do not start. The delay of running by 5 minutes of containers Docker does not help. I used: /etc/rc.d/rc.docker start /etc/rc.d/rc.docker stop but it's bad. Edited October 9, 2022 by Marolo Quote Link to comment
Squid Posted October 9, 2022 Share Posted October 9, 2022 One way would be to set all of the containers to NOT autostart and in your script add in the following to start up the containers: docker start mosquitto docker start syncthing . . . Quote Link to comment
Marolo Posted October 9, 2022 Author Share Posted October 9, 2022 (edited) Script: #!/bin/bash #/etc/rc.d/rc.docker stop printf "MT - %s" "czekam na uruchomienie pfSense ..." while ! ping -c 1 -n -w 1 192.168.1.1 &> /dev/null do printf "%c" "." done printf "\n%s\n" "MT - pfSense jest już online" printf "\n%s\n" "MT - Uruchamian Docker'a" #/etc/rc.d/rc.docker start docker start mosquitto docker start syncthing printf "\n%s\n" "MT - Docker uruchomiony" Log: Script location: /tmp/user.scripts/tmpScripts/pfSense_Czy_Działa/script Note that closing this window will abort the execution of this script MT - czekam na uruchomienie pfSense ... MT - pfSense jest już online MT - Uruchamian Docker'a Error response from daemon: network br0 not found Error: failed to start containers: mosquitto Error response from daemon: network br0 not found Error: failed to start containers: syncthing MT - Docker uruchomiony Manual start: To start the Docker containers: Settings -> Docker -> Enabled Docker = No Settings -> Docker -> Enabled Docker = Yes Edited October 9, 2022 by Marolo Quote Link to comment
Recommended Posts
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.