From f5b748198ef2518bd7546b83e73f6cf385f3803b Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Fri, 17 Mar 2023 10:28:52 +0100 Subject: [PATCH] Updated and fixed StreamFlow Dockerfile This commit fixes an error on the Dockerfile specification, which prevented the StreamFlow dependencies from being correctly installed. Plus, it moves streamflow from the `/root/.local/` folder to the `/opt/streamflow` system-wide location, allowing non-root executions of the container. Finally, it updates the root container from Python3.8 to Python 3.11. Fixes #94. --- Dockerfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 058a77f5..cdfa9b80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,17 @@ -FROM python:3.8-alpine3.13 AS builder +FROM python:3.11-alpine3.16 AS builder ARG HELM_VERSION -ENV PYTHONPATH="${PYTHONPATH}:/build" -ENV PATH="/root/.local/bin:${PATH}" +ENV VIRTUAL_ENV="/opt/streamflow" +ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" COPY ./pyproject.toml ./MANIFEST.in ./LICENSE ./README.md /build/ COPY ./requirements.txt \ - ./docs/requirements.txt \ ./bandit-requirements.txt \ ./lint-requirements.txt \ ./report-requirements.txt \ ./test-requirements.txt \ /build/ +COPY ./docs/requirements.txt /build/docs COPY ./streamflow /build/streamflow RUN apk --no-cache add \ @@ -26,19 +26,20 @@ RUN apk --no-cache add \ musl-dev \ openssl \ openssl-dev \ - && curl -L https://git.io/get_helm.sh -o /tmp/get_helm.sh \ + && curl -fsSL https://git.io/get_helm.sh -o /tmp/get_helm.sh \ && chmod +x /tmp/get_helm.sh \ && /tmp/get_helm.sh --version ${HELM_VERSION} \ && cd /build \ - && pip install --user . + && python -m venv ${VIRTUAL_ENV} \ + && pip install . -FROM python:3.8-alpine3.13 +FROM python:3.11-alpine3.16 LABEL maintainer="iacopo.colonnelli@unito.it" -ENV PATH="/root/.local/bin:${PATH}" -ENV PYTHONPATH="/root/.local:${PYTHONPATH}" +ENV VIRTUAL_ENV="/opt/streamflow" +ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" -COPY --from=builder "/root/.local/" "/root/.local/" +COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} COPY --from=builder /usr/local/bin/helm /usr/local/bin/helm RUN apk --no-cache add \