-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
51 lines (38 loc) · 1.79 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Package path for this plugin module relative to the repo root
ARG package=arcaflow_plugin_aws_ec2_control
# 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.4.2 as build
ARG package
COPY poetry.lock /app/
COPY pyproject.toml /app/
# Convert the dependencies from poetry to a static requirements.txt file
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
ENV PYTHONPATH /app/${package}
WORKDIR /app/${package}
# Run tests and return coverage analysis
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.4.2
ARG package
COPY --from=build /app/requirements.txt /app/
COPY --from=build /htmlcov /htmlcov/
COPY LICENSE /app/
COPY README.md /app/
COPY ${package}/ /app/${package}
# Install all plugin dependencies from the generated requirements.txt file
RUN python -m pip install -r requirements.txt
WORKDIR /app/${package}
ENTRYPOINT ["python", "ec2_plugin.py"]
CMD []
LABEL org.opencontainers.image.source="https://github.com/arcalot/arcaflow-plugin-aws-ec2-control"
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.vendor="Arcalot project"
LABEL org.opencontainers.image.authors="Arcalot contributors"
LABEL org.opencontainers.image.title="Arcaflow AWS EC2 control plugin"
LABEL io.github.arcalot.arcaflow.plugin.version="1"