Skip to content

Commit

Permalink
bump base images release and simplify python commands (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinblack authored Jul 10, 2023
1 parent 0fdd7b5 commit 4294542
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ ARG package=arcaflow_plugin_template_python
# STAGE 1 -- Build module dependencies and run tests
# The 'poetry' and 'coverage' modules are installed and verson-controlled in the
# quay.io/arcalot/arcaflow-plugin-baseimage-python-buildbase image to limit drift
FROM quay.io/arcalot/arcaflow-plugin-baseimage-python-buildbase:0.1.0 as build
FROM quay.io/arcalot/arcaflow-plugin-baseimage-python-buildbase:0.2.0 as build
ARG package

COPY poetry.lock /app/
COPY pyproject.toml /app/

# Convert the dependencies from poetry to a static requirements.txt file
RUN python3.9 -m poetry install --without dev --no-root \
&& python3.9 -m poetry export -f requirements.txt --output requirements.txt --without-hashes
RUN python -m poetry install --without dev --no-root \
&& python -m poetry export -f requirements.txt --output requirements.txt --without-hashes

COPY ${package}/ /app/${package}
COPY tests /app/${package}/tests
Expand All @@ -21,12 +21,12 @@ ENV PYTHONPATH /app/${package}
WORKDIR /app/${package}

# Run tests and return coverage analysis
RUN python3.9 -m coverage run tests/test_${package}.py \
&& python3.9 -m coverage html -d /htmlcov --omit=/usr/local/*
RUN python -m coverage run tests/test_${package}.py \
&& python -m coverage html -d /htmlcov --omit=/usr/local/*


# STAGE 2 -- Build final plugin image
FROM quay.io/arcalot/arcaflow-plugin-baseimage-python-osbase:0.1.0
FROM quay.io/arcalot/arcaflow-plugin-baseimage-python-osbase:0.2.0
ARG package

COPY --from=build /app/requirements.txt /app/
Expand All @@ -36,11 +36,11 @@ COPY README.md /app/
COPY ${package}/ /app/${package}

# Install all plugin dependencies from the generated requirements.txt file
RUN python3.9 -m pip install -r requirements.txt
RUN python -m pip install -r requirements.txt

WORKDIR /app/${package}

ENTRYPOINT ["python3.9", "arcaflow_plugin_template_python.py"]
ENTRYPOINT ["python", "arcaflow_plugin_template_python.py"]
CMD []

LABEL org.opencontainers.image.source="https://github.com/arcalot/arcaflow-plugin-template-python"
Expand Down

0 comments on commit 4294542

Please sign in to comment.