Docker Engine start after starting VM (PFSense)


Marolo

Recommended Posts

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.

image.thumb.png.3eaf19fe50a2f823cd9b76d6d4e0f282.png

 

 

image.png.25548d48d935b8c1f46ce7920235ad92.png

 

 

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 by Marolo
Link to comment

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

 

image.png.f6d59508d30b25627ace93e050cdcb02.png

 

Manual start:

image.png.89679592e4b40f1bce854a2cbea3f1d5.png

 

 

To start the Docker containers:

 

Settings -> Docker -> Enabled Docker = No

Settings -> Docker -> Enabled Docker = Yes

 

 

 

Edited by Marolo
Link to comment

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.