From 4b5a4e0583cce9b56d7e60b31265f24013eac734 Mon Sep 17 00:00:00 2001 From: edsoncsouza Date: Sun, 1 Dec 2024 19:59:15 +0000 Subject: [PATCH] Remove unnecessary changes --- container/Dockerfile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/container/Dockerfile b/container/Dockerfile index 93cc124ee..c108cf759 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -11,10 +11,9 @@ ENV PIP_REQUIRE_VIRTUALENV=true # Install golang needed by extensions ENV GO_VERSION=1.21.0 ENV PATH="/usr/local/go/bin:${PATH}" -RUN wget --progress=dot:giga \ - "https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" \ - && tar -C /usr/local -xzf "go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" \ - && rm "go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" +RUN wget --progress=dot:giga "https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" \ + && tar -C /usr/local -xzf "go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" \ + && rm "go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" # Copy the requirements.txt and install dependencies in venv. Using a separate # command to use layer caching. @@ -30,9 +29,9 @@ COPY . /build/karapace-repo WORKDIR /build/karapace-repo RUN --mount=type=cache,target=/root/.cache/pip \ if [ -z "${KARAPACE_VERSION}" ]; then \ - PRETEND_VERSION="$(python -c 'from src.karapace import version; print(version.__version__)')"; \ + PRETEND_VERSION="$(python -c 'from src.karapace import version; print(version.__version__)')"; \ else \ - PRETEND_VERSION=$KARAPACE_VERSION; \ + PRETEND_VERSION=$KARAPACE_VERSION; \ fi; \ SETUPTOOLS_SCM_PRETEND_VERSION=$PRETEND_VERSION python3 -m pip install --no-deps . @@ -40,24 +39,26 @@ RUN --mount=type=cache,target=/root/.cache/pip \ FROM python:3.10.11-slim-bullseye AS karapace # Setup user and directories. +# https://docs.redhat.com/en/documentation/openshift_container_platform/4.17/html/images/creating-images#use-uid_create-images RUN useradd --system --gid 0 karapace \ - && mkdir /opt/karapace /opt/karapace/runtime /var/log/karapace \ - && chgrp -R 0 /opt/karapace /opt/karapace/runtime /var/log/karapace \ - && chmod -R g+rwX /opt/karapace + && mkdir /opt/karapace /opt/karapace/runtime /var/log/karapace \ + && chgrp -R 0 /opt/karapace /opt/karapace/runtime /var/log/karapace \ + && chmod -R g+rwX /opt/karapace # Install protobuf compiler. ARG PROTOBUF_COMPILER_VERSION="3.12.4-1+deb11u1" RUN apt-get update \ - && apt-get install --assume-yes --no-install-recommends \ + && apt-get install --assume-yes --no-install-recommends \ protobuf-compiler=$PROTOBUF_COMPILER_VERSION \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* # Copy virtualenv from builder and activate it. COPY --from=builder /venv /venv ENV PATH="/venv/bin:$PATH" COPY ./container/start.sh /opt/karapace -RUN chmod 550 /opt/karapace/start.sh +RUN chmod 550 /opt/karapace/start.sh \ + && chgrp -R 0 /opt/karapace/start.sh COPY ./container/healthcheck.py /opt/karapace @@ -66,4 +67,3 @@ USER karapace HEALTHCHECK --interval=10s --timeout=30s --retries=3 --start-period=60s \ CMD python3 healthcheck.py http://localhost:$KARAPACE_PORT/_health || exit 1 -