improved Dockerfile
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing

This commit is contained in:
2023-08-14 19:01:06 +02:00
parent 29885020f6
commit 8baa8f3d16

View File

@ -6,11 +6,6 @@ ARG JAVA_VERSION="20.0.2-graal"
ENV SDKMAN_DIR=/root/.sdkman 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 \ RUN apt-get update \
&& apt-get install -y --no-install-recommends curl zip unzip ca-certificates locales \ && apt-get install -y --no-install-recommends curl zip unzip ca-certificates locales \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ && 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_auto_selfupdate=false" >> "${SDKMAN_DIR}"/etc/config \
&& echo "sdkman_insecure_ssl=true" >> "${SDKMAN_DIR}"/etc/config \ && echo "sdkman_insecure_ssl=true" >> "${SDKMAN_DIR}"/etc/config \
&& chmod +x "${SDKMAN_DIR}"/bin/sdkman-init.sh \ && 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 \ RUN bash -c "source "${SDKMAN_DIR}"/bin/sdkman-init.sh \
&& sdk version \ && sdk version \
@ -34,7 +31,7 @@ USER container
WORKDIR /home/container WORKDIR /home/container
ENV USER container ENV USER container
ENV HOME /home/container ENV HOME /home/container
COPY entrypoint.sh /home/container
SHELL ["/bin/bash", "-i", "-c"] SHELL ["/bin/bash", "-i", "-c"]
ENTRYPOINT [ "/root/entrypoint.sh" ] ENTRYPOINT [ "/root/entrypoint.sh" ]