From 1b103e1f5f1607830e4b907c3348ea96aff7dbf8 Mon Sep 17 00:00:00 2001 From: Bobby Wang Date: Sat, 30 Apr 2022 10:00:35 +0800 Subject: [PATCH] [CI] make container be able to re-attached (#7848) When re-starting the container, it will fail in entrypoint.sh which will exit when adding an existing group or user --- tests/ci_build/entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ci_build/entrypoint.sh b/tests/ci_build/entrypoint.sh index 8e830399f..a0c5f56bb 100755 --- a/tests/ci_build/entrypoint.sh +++ b/tests/ci_build/entrypoint.sh @@ -20,9 +20,9 @@ else fi if [[ -n $CI_BUILD_UID ]] && [[ -n $CI_BUILD_GID ]]; then - groupadd -o -g "${CI_BUILD_GID}" "${CI_BUILD_GROUP}" + groupadd -o -g "${CI_BUILD_GID}" "${CI_BUILD_GROUP}" || true useradd -o -m -g "${CI_BUILD_GID}" -u "${CI_BUILD_UID}" \ - "${CI_BUILD_USER}" + "${CI_BUILD_USER}" || true export HOME="/home/${CI_BUILD_USER}" shopt -s dotglob cp -r /root/* "$HOME/"