Skip to content

Commit

Permalink
Updated and fixed StreamFlow Dockerfile
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GlassOfWhiskey committed Mar 17, 2023
1 parent 4142b45 commit f5b7481
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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 \
Expand Down

0 comments on commit f5b7481

Please sign in to comment.