Nethserver-docker version not up to date

Hi all,

The version of nethserver-docker is: 19.03.8, build afacb8b.

The latest stable docker version: 20.10.7, build f0df350

f0df350 - afacb8b = a few thousands builds ?

The nethserver-docker doesn’t take the container-option “--restart unless-stopped

Michel-André

@davidep or @stephdl
Can you update it?

1 Like

Anyone knows which version is delivered by CentOS 7?

1 Like

@michelandre You need to use/enable the repo first, see https://docs.nethserver.org/en/v7/docker.html#docker-repository

2 Likes

We cannot update it like this…someone with the old version could have its containers in a weird state after the upgrade. I prefer to let this to the hands of the sysadmin

2 Likes

Therefore a guideline/best practice/ sample procedure might be useful?
Don’t look at my helmet, i am a virtualization fan, not a container dude.

4 Likes

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é

2 Likes

We restart portainer when restarting docker via systemctl else portainer can’t reach the Docker socket anymore.

image

You may edit /usr/libexec/dockerRestartPortainer and comment out the last line like:

#/usr/bin/docker restart portainer

Now portainer should be exited if stopped before the restart of docker if “unless-stopped” is used but we have the “Failed loading endpoint” issue in portainer.

Did you check if portainer is connected and working after the restart?

2 Likes

Hi @mrmarkuz,

This forum is really the best one to find a solution to any problem.

Stopping Portainer

[root@toto ~]# docker stop portainer
portainer
[root@toto ~]#

Portainer is stopped (Exited)

[root@toto ~]# docker ps -a
CONTAINER ID   IMAGE                    COMMAND                  CREATED        STATUS                     PORTS     NAMES
681ec9ebdb44   portainer/portainer-ce   "/portainer --ssl --…"   26 hours ago   Exited (2) 6 seconds ago             portainer
19d2171f05ff   local_discourse/app      "/sbin/boot"             30 hours ago   Up 2 hours                           app
[root@toto ~]#

Restarting of Docker

[root@toto ~]# systemctl restart docker
[root@toto ~]#

Portainer is still stopped (Exited) as it should be.

[root@toto ~]# docker ps -a
CONTAINER ID   IMAGE                    COMMAND                  CREATED        STATUS                      PORTS     NAMES
681ec9ebdb44   portainer/portainer-ce   "/portainer --ssl --…"   26 hours ago   Exited (2) 52 seconds ago             portainer
19d2171f05ff   local_discourse/app      "/sbin/boot"             30 hours ago   Up 2 hours                            app
[root@toto ~]#

Now, if I ever need to use Portainer, I just start it.

[root@toto ~]# docker start portainer
portainer
[root@toto ~]#

[root@toto ~]# docker ps -a
CONTAINER ID   IMAGE                    COMMAND                  CREATED        STATUS         PORTS                                                 NAMES
681ec9ebdb44   portainer/portainer-ce   "/portainer --ssl --…"   26 hours ago   Up 5 seconds   8000/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp   portainer
19d2171f05ff   local_discourse/app      "/sbin/boot"             30 hours ago   Up 2 hours                                                           app
[root@toto ~]#

Portainer is available.

NOTE: I have to say that I installed Portainer from scratch, not using the one from NethServer.

image

  • When I finish using Portainer, I stop it.
  • When Portainer is not running, the server has a little bit more memory.

Thank you very much for, again, finding the solution.

Michel-André

2 Likes