From 8baa8f3d16c614664246a938d21c8f74c17ed49d Mon Sep 17 00:00:00 2001 From: uzurka Date: Mon, 14 Aug 2023 19:01:06 +0200 Subject: [PATCH] improved Dockerfile --- Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5ef7c00..c45ba90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,6 @@ ARG JAVA_VERSION="20.0.2-graal" ENV SDKMAN_DIR=/root/.sdkman -COPY entrypoint.sh /home/container - -RUN useradd -d /home/container -m container -s /bin/bash -p 'none' \ - && passwd -d container - RUN apt-get update \ && apt-get install -y --no-install-recommends curl zip unzip ca-certificates locales \ && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ @@ -22,6 +17,8 @@ RUN apt-get update \ && echo "sdkman_auto_selfupdate=false" >> "${SDKMAN_DIR}"/etc/config \ && echo "sdkman_insecure_ssl=true" >> "${SDKMAN_DIR}"/etc/config \ && chmod +x "${SDKMAN_DIR}"/bin/sdkman-init.sh \ + && useradd -d /home/container -m container -s /bin/bash -p 'none' \ + && passwd -d container RUN bash -c "source "${SDKMAN_DIR}"/bin/sdkman-init.sh \ && sdk version \ @@ -34,7 +31,7 @@ USER container WORKDIR /home/container ENV USER container ENV HOME /home/container - +COPY entrypoint.sh /home/container SHELL ["/bin/bash", "-i", "-c"] ENTRYPOINT [ "/root/entrypoint.sh" ] \ No newline at end of file