Hi @mrmarkuz and @stephdl
After stopping all containers, I updated Docker of NethServer-Discourse according to: https://docs.nethserver.org/en/v7/docker.html#docker-repository.
[root@toto ~]# config show docker
docker=service
DirectLvmDevice=
IpAddress=172.28.0.1
Network=172.28.0.0/16
bridgeAeria=
enableRepository=disabled
macVlanGateway=
macVlanLocalNetwork=
macVlanNetwork=
macVlanNic=
status=enabled
[root@toto ~]#
[root@toto ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
681ec9ebdb44 portainer/portainer-ce "/portainer --ssl --…" 20 hours ago Up 4 minutes 8000/tcp, 0.0.0.0:9000->9000/tcp portainer
19d2171f05ff local_discourse/app "/sbin/boot" 24 hours ago Up 5 minutes app
[root@toto ~]#
[root@toto ~]# docker stop portainer app
portainer
app
[root@toto ~]#
[root@toto ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
681ec9ebdb44 portainer/portainer-ce "/portainer --ssl --…" 20 hours ago Exited (2) 14 seconds ago portainer
19d2171f05ff local_discourse/app "/sbin/boot" 24 hours ago Exited (5) 6 seconds ago app
[root@toto ~]#
[root@toto ~]# yum update -y --enablerepo=docker-ce-stable
...
Résumé de la transaction
============================================================================================
Installation ( 5 Paquets en dépendance)
Mettre à jour 3 Paquets
Taille totale des téléchargements : 103 M
...
Dépendances installées :
docker-ce-rootless-extras.x86_64 0:20.10.7-3.el7 docker-scan-plugin.x86_64 0:0.8.0-3.el7
fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 fuse3-libs.x86_64 0:3.6.1-4.el7
slirp4netns.x86_64 0:0.4.3-4.el7_8
Mis à jour :
containerd.io.x86_64 0:1.4.8-3.1.el7 docker-ce.x86_64 3:20.10.7-3.el7
docker-ce-cli.x86_64 1:20.10.7-3.el7
Terminé !
[root@toto ~]#
Docker is at the latest version
[root@toto ~]# docker --version
Docker version 20.10.7, build f0df350 <=================== LATEST VERSION
[root@toto ~]#
● The update restarted Docker, so it started all the containers.
● Portainer is UP => this is an error, it should be “Exited” because it was installed with the option “--restart unless-stopped
” and it was stopped before the update of Docker.
[root@toto ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
681ec9ebdb44 portainer/portainer-ce "/portainer --ssl --…" 20 hours ago Up 44 seconds 8000/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp portainer
19d2171f05ff local_discourse/app "/sbin/boot" 24 hours ago Up About a minute app
[root@toto ~]#
Testing Portainer with a restart of Docker
[root@toto ~]# docker stop portainer
portainer
[root@toto ~]#
Portainer is surely "Exited "
[root@toto ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
681ec9ebdb44 portainer/portainer-ce "/portainer --ssl --…" 20 hours ago Exited (2) 6 seconds ago portainer
19d2171f05ff local_discourse/app "/sbin/boot" 24 hours ago Up 5 minutes app
[root@toto ~]#
Restarting Docker
[root@toto ~]# systemctl restart docker
[root@toto ~]#
● After a systemctl restart docker
or a reboot
of the server, Portainer is UP => this is an error, it should still be “Exited” because it was installed with the option “--restart unless-stopped
”.
[root@toto ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
681ec9ebdb44 portainer/portainer-ce "/portainer --ssl --…" 20 hours ago Up 13 seconds 8000/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp portainer
19d2171f05ff local_discourse/app "/sbin/boot" 24 hours ago Up 4 minutes app
[root@toto ~]#
CONCLUSION:
-
After stopping all containers, the update of Docker according to https://docs.nethserver.org/en/v7/docker.html#docker-repository is working correctly.
-
Nethserver-discourse is still working correctly after the update of Docker.
-
For the option “--restart unless-stopped
”, if I install the standard Docker, it works as it should i.e. not restarted but staying “Exited” after a reboot or a restart of Docker !!!
Special thanks to Markus for pointing at the right solution.
Michel-André