From 29c976b326ac4b451329cdead4ec1cd17a2055f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Wed, 4 Feb 2015 14:24:19 +0100 Subject: [PATCH] Core: drop live-build/ubuntu-core/hooks/12-add-docker-user.chroot and move docker user creation to live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early; add ubuntu user to docker group in live-build/ubuntu-core/hooks/02-add_user_to_groups.chroot. This fixes static uid/gid maps for docker user/group. --- debian/changelog | 6 ++++++ .../hooks/00-uid-gid-fix.chroot_early | 4 ++++ .../hooks/02-add_user_to_groups.chroot | 2 +- .../hooks/12-add-docker-user.chroot | 18 ------------------ 4 files changed, 11 insertions(+), 19 deletions(-) delete mode 100644 live-build/ubuntu-core/hooks/12-add-docker-user.chroot diff --git a/debian/changelog b/debian/changelog index 8c3a831b..a889cbb1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,12 @@ livecd-rootfs (2.278) UNRELEASED; urgency=medium error message changed. Currently, the passwd/group checks weren't run. * live-build/ubuntu-touch/hooks/00-uid-gid-fix.chroot_early: also add input group. + * Core: drop live-build/ubuntu-core/hooks/12-add-docker-user.chroot and move + docker user creation to + live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early; add ubuntu user + to docker group in + live-build/ubuntu-core/hooks/02-add_user_to_groups.chroot. This fixes + static uid/gid maps for docker user/group. -- Loïc Minier Wed, 04 Feb 2015 13:39:26 +0100 diff --git a/live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early b/live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early index df651ddc..766cc44e 100755 --- a/live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early +++ b/live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early @@ -40,6 +40,7 @@ systemd-timesync:x:103:108:systemd Time Synchronization,,,:/run/systemd:/bin/fal systemd-network:x:104:109:systemd Network Management,,,:/run/systemd/netif:/bin/false systemd-resolve:x:105:110:systemd Resolver,,,:/run/systemd/resolve:/bin/false systemd-bus-proxy:x:106:111:systemd Bus Proxy,,,:/run/systemd:/bin/false +docker:x:107:113::/nonexistent:/bin/false EOF else echo "/etc/passwd post-debootstrap hash doesn't match record" >&2 @@ -74,6 +75,7 @@ systemd-timesync:*:16413:0:99999:7::: systemd-network:*:16413:0:99999:7::: systemd-resolve:*:16413:0:99999:7::: systemd-bus-proxy:*:16413:0:99999:7::: +docker:*:16413:0:99999:7::: EOF else echo "/etc/shadow post-debootstrap hash doesn't match record" >&2 @@ -134,6 +136,7 @@ systemd-network:x:109: systemd-resolve:x:110: systemd-bus-proxy:x:111: input:x:112: +docker:x:113: EOF else echo "/etc/group post-debootstrap hash doesn't match record" >&2 @@ -194,6 +197,7 @@ systemd-network:!:: systemd-resolve:!:: systemd-bus-proxy:!:: input:!:: +docker:!:: EOF else echo "/etc/gshadow post-debootstrap hash doesn't match record" >&2 diff --git a/live-build/ubuntu-core/hooks/02-add_user_to_groups.chroot b/live-build/ubuntu-core/hooks/02-add_user_to_groups.chroot index 2e48e233..f0f93946 100755 --- a/live-build/ubuntu-core/hooks/02-add_user_to_groups.chroot +++ b/live-build/ubuntu-core/hooks/02-add_user_to_groups.chroot @@ -2,7 +2,7 @@ USER=ubuntu -DEFGROUPS="sudo" +DEFGROUPS="docker sudo" echo "I: add $USER to ($DEFGROUPS) group(s)" usermod -a -G ${DEFGROUPS} ${USER} diff --git a/live-build/ubuntu-core/hooks/12-add-docker-user.chroot b/live-build/ubuntu-core/hooks/12-add-docker-user.chroot deleted file mode 100644 index bc805186..00000000 --- a/live-build/ubuntu-core/hooks/12-add-docker-user.chroot +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -x - -# FIXME: add click hook for user creation - -USER=docker - -echo "I: creating docker user" - -addgroup --system --quiet $USER -adduser --system \ - --ingroup $USER \ - --disabled-login \ - --shell /bin/false \ - --no-create-home \ - $USER - -# ensure that the ubuntu user has the right group -adduser ubuntu docker