From 0c9226aa727cb803a158c9d5c0831ebef73031bc Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 3 Jun 2024 17:20:02 +0900 Subject: [PATCH] Run useradd if ubuntu user is not available --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2406a29..7b145b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -119,7 +119,9 @@ RUN set -ex && \ apt-get clean && rm -r /var/lib/apt/lists/* RUN set -ex && \ - useradd -ms /bin/bash ubuntu + if ! (id ubuntu &>/dev/null); then \ + useradd -ms /bin/bash ubuntu; \ + fi RUN mkdir -p /usr/local/etc