aboutsummaryrefslogtreecommitdiff
path: root/tcwg-base
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-06-06 08:49:30 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-06-06 08:49:30 +0000
commitdd3b80b7d96cf10c238e22f857f892b1bc0a498f (patch)
treec082a73a7fbada5fa32ce01467222039aed254d8 /tcwg-base
parentd6d118dcd94f8d086743653c43b9042fb7a6e18c (diff)
tcwg-host: Keep /home-data in the final image
... to be able to re-use /home volume from previous container instance, where some entries might not exist. We plan to re-use host-home:/home volume from previous container/image version, so we need a way to initialize /home/$new_user directories. With /home-data around this is as simple as "mv /home-data/$new_user /home/$new_user". Change-Id: I416e81c05d3efea8cfdbb905863929db0d0714ec
Diffstat (limited to 'tcwg-base')
-rwxr-xr-xtcwg-base/new-user.sh10
-rw-r--r--tcwg-base/tcwg-host/Dockerfile.in3
2 files changed, 8 insertions, 5 deletions
diff --git a/tcwg-base/new-user.sh b/tcwg-base/new-user.sh
index 5f36b5f8..210d5de2 100755
--- a/tcwg-base/new-user.sh
+++ b/tcwg-base/new-user.sh
@@ -68,8 +68,12 @@ if [ x"$user" != x"" ]; then
chmod 0440 $sudoers_file
if [ x"$home_data" != x"" ]; then
- chown -R $user${gid:+:$gid} /home-data/$user/; \
- chmod -R go-rwx /home-data/$user/.ssh/ ; \
- rsync -a /home-data/$user/ /home/$user/; \
+ chown -R $user${gid:+:$gid} /home-data/$user/
+ chmod -R go-rwx /home-data/$user/.ssh/
+ rsync -a /home-data/$user/ /home/$user/
+ # Make /home-data/$user a prestine copy of $user's /home to have
+ # access to files even when /home volume is reused from previous
+ # container instance.
+ rsync -a /home/$user/ /home-data/$user/
fi
fi
diff --git a/tcwg-base/tcwg-host/Dockerfile.in b/tcwg-base/tcwg-host/Dockerfile.in
index 5f8e5123..81b53009 100644
--- a/tcwg-base/tcwg-host/Dockerfile.in
+++ b/tcwg-base/tcwg-host/Dockerfile.in
@@ -6,7 +6,6 @@ RUN new-user.sh --group tcwg-infra:9000 \
&& new-user.sh --group tcwg-users:10000 \
&& while read line; do \
new-user.sh --passwd "$line" --home-data /home-data; \
- done </home-data/passwd \
- && rm -rf /home-data/
+ done </home-data/passwd
COPY start.sh /