forked from Backblaze/B2_Command_Line_Tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.template
32 lines (25 loc) · 965 Bytes
/
Dockerfile.template
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
FROM python:${python_version}-slim as builder
RUN apt-get update -y && apt-get install git patchelf -y && pip install -U pdm
WORKDIR /b2
COPY ./b2 /b2/b2
COPY pyproject.toml pdm.lock LICENSE README.md /b2/
ENV PDM_BUILD_SCM_VERSION=${version}
RUN pdm install --prod --group license
RUN pdm run b2 license --dump --with-packages
# Run pdm in PEP 582 mode, install packaged to __pypackages__, not virtualenv
RUN rm -r .venv && mkdir __pypackages__ && pdm install --prod --group full --no-editable
FROM python:${python_version}-slim
LABEL vendor=${vendor}
LABEL name="${name}"
LABEL description="${description}"
LABEL version="${version}"
LABEL url="${url}"
LABEL vcs-url="${vcs_url}"
LABEL vcs-ref="${vcs_ref}"
LABEL build-date-iso8601="${build_date}"
ENV PYTHONPATH=/opt/b2
COPY --from=builder /b2/__pypackages__/${python_version}/lib /opt/b2
COPY --from=builder /b2/__pypackages__/${python_version}/bin/* /bin/
WORKDIR /root
ENTRYPOINT ["b2"]
CMD ["--help"]