If it allows then backup your pihole settings, remove container & pull again then restore settings.Please, how can I upgrade container, more specific pihole. I'm used to SSH, but I have no idea how to do it in RouterOS and I cannot find anything relevant to this topic. Thanks.
Or is my logic flawed ?
Now that funny and 100% spot on.often phrased as the "cattle vs pets" analogy. If you can't "slaughter" your cattle and bring new ones into their place without major disruption, you're doing something wrong.
Well... That is not very user friendly. I'll probably stick with RPi and SSH.If it allows then backup your pihole settings, remove container & pull again then restore settings.Please, how can I upgrade container, more specific pihole. I'm used to SSH, but I have no idea how to do it in RouterOS and I cannot find anything relevant to this topic. Thanks.
I'll probably stick with RPi and SSH.
I think the point is generally with containers if you ever need to use SSH to change them, you may be doing something wrong. *unless your trying to develop/test a new Dockerfile or modify something that is a "mounted"... The key thing to understand is data/config and code are designed to be seperate, so it should be completely safe to just the replace the code part, while leaving the data/config part stays same.Well... That is not very user friendly. I'll probably stick with RPi and SSH.
# find your pihole container's ID (generally 0) that you want to upgrade
/container/print
# remove container
/container/remove 0
# re-add same container
/container/add file=pihole.tar interface=veth1 envlist=pihole_envs mounts=dnsmasq_pihole,etc_pihole hostname=PiHole
Mikrotiks are generally "pets"
I 100% agree. More thinking the OP was trying to "upgrade PiHole", which does take a little container philosophy to understand. But II think the metaphor was getting lost - but not wrong.It isn't necessarily soMikrotiks are generally "pets"
Not mix metaphors. But the "reincarnate" method is what's missing.Incidentally, this thread inspired me to come up with a better analogy.
I would prefer to update simple by pressing a button in GUI, that's why more people prefer Adguard over pihole.I think the point is generally with containers if you ever need to use SSH to change them, you may be doing something wrong.
I'd add logging=yesI have scripted it however the container status is always “error” after running the script. Issuing the same commands works.
/container/stop 0
:delay 20s;
/container/remove 0
/container/add remote-image=pihole/pihole:latest interface=veth1 root-dir=disk1/pihole mounts=dnsmasq_pihole,etc_pihole envlist=pihole_envs hostname=pihole start-on-boot=yes
:delay 60s;
/container/start 0
# update_pihole.rsc
/container/stop [find where repo="registry-1.docker.io/pihole/pihole:latest"]
:delay 5
/container/remove [find where repo="registry-1.docker.io/pihole/pihole:latest"]
:delay 1
/container/add remote-image="pihole/pihole:latest" interface=veth1 envlist=pihole_envs root-dir=usb1/pihole mounts=dnsmasq_pihole,etc_pihole domain-name="my.home.lan" logging=yes start-on-boot=yes
:delay 90
/container/start [find where repo="registry-1.docker.io/pihole/pihole:latest"]
:foreach i in=[/container/print as-value] do={ :if ($i->"repo"!="") do={ :put ($i->"repo") } }
registry-1.docker.io/pihole/pihole:latest
registry-1.docker.io/netbirdio/netbird:latest
{
/container;
:local HN "{{.hostname}}";
:local TAG "{{.TAG}}";
:local FN "{{.TAR}}";
:local START [/system/clock/get time];
print where tag=$TAG;
:while ([find where tag=$TAG status=running]) do={stop [find tag=$TAG status=running]; :delay 1;};
:while ([find where tag=$TAG status=stopped]) do={remove [find tag=$TAG status=stopped]; :delay 1;};
:while ([find where tag=$TAG]) do={:delay 0.1;};
add file=$FN envlist={{.env}} hostname=$HN interface=v{{.env}} logging=yes start-on-boot=yes;
:while ([:len [find where tag=$TAG]]=0) do={:delay 0.1;};
start [find tag=$TAG];
:while ([find where tag=$TAG status=stopped]) do={:delay 0.1;};
print where tag=$TAG;
:delay 1; # Delay to show startup logs.
/log/print where time>$START topics=container,info,debug;
}
/ip dns
set servers=1.1.1.1
/container/stop [find where comment~"adguard"]
:while ( [/container print count-only where comment~"adguard" status=stopping] > 0) do={ :delay 1 }
/container/remove [find where comment~"adguard"]
:delay 5
/container/add interface="adguard" remote-image="adguard/adguardhome:latest" mounts="adguard_conf,adguard_work" root-dir="usb1/apps/adguard/root" start-on-boot=yes logging=no comment="adguard"
:delay 3
:while ( [/container print count-only where comment~"adguard" status=extracting] > 0 ) do { :delay 1 }
/container/start [find where comment~"adguard"]
/ip dns
set servers=10.0.0.2
The simplest way to perform an update is through Winbox in the "container" section, and then in CMD with the command "--update".