minishift / minishift-centos-iso

CentOS based ISO as an alternative for boot2docker ISO
GNU Lesser General Public License v3.0
40 stars 33 forks source link

/etc/docker does not persist after a restart #253

Closed LalatenduMohanty closed 6 years ago

LalatenduMohanty commented 6 years ago

After a minishift start;minishift stop; minishift start the directory to keep docker certs does not persist i.e. /etc/docker. Hence we are seeing https://github.com/minishift/minishift/issues/2545

It was working in CentOS ISO version 1.5.0 [1] but we changed it later.

As of now with Minishift 1.20.0 version we see below

$ sudo ls -l /etc/docker/certs.d/
total 12
drwxr-xr-x. 2 root root 4096 May 28 08:19 redhat.com
drwxr-xr-x. 2 root root 4096 May 28 08:19 redhat.io
drwxr-xr-x. 2 root root 4096 May 28 08:19 registry.access.redhat.com

But expected is as below.

$ sudo ls -l /etc/docker/certs.d/
total 16
drwxr-xr-x. 2 docker root 4096 Jul  3 08:38 docker-registry-default.192.168.64.5.nip.io
drwxr-xr-x. 2 root   root 4096 May 28 08:19 redhat.com
drwxr-xr-x. 2 root   root 4096 May 28 08:19 redhat.io
drwxr-xr-x. 2 root   root 4096 May 28 08:19 registry.access.redhat.com

inishift-centos-iso/blob/v1.5.0/scripts/handle-user-data#L49-L51

gbraad commented 6 years ago

This is not an issue that needs to be resolved in the ISO. The information about the routing prefix is only known in minishift, and should be provisioned during the start.

praveenkumar commented 6 years ago

This is something we need to add back

    mkdir -p /mnt/$PARTNAME/var/lib/boot2docker/etc/docker
    mkdir -p /etc/docker
    mount --bind /mnt/$PARTNAME/var/lib/boot2docker/etc/docker /etc/docker
LalatenduMohanty commented 6 years ago

We had removed it as part of #226 https://github.com/minishift/minishift-centos-iso/commit/fbe8593be1e5525a323af4396162324f860cba89#diff-b58989df8ca966e0064a92395063f7e7 The issue was Docker version has been updated to 1.13.1 in RHEL which is the cause of failure for RHEL ISO. This is happening because of updated version of RHEL/CentOS tree now also require /etc/docker/seccomp.json and since we are removing this directory and again put to bind mount this file is not present.

gbraad commented 6 years ago

The steps would have been to

LalatenduMohanty commented 6 years ago
  • bind mount

Then copy back the seccomp.json.

gbraad commented 6 years ago

This is something we need to add back

@praveenkumar I am not so sure we need to. The state is restored on restart anyway...