-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
31 lines (26 loc) · 903 Bytes
/
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
ARG ARCH=armv7hf
ARG PYTHON_VERSION=3.8
ARG PKG=oci-cli
ARG PKG_VERSION=3.50.2
FROM balenalib/${ARCH}-debian-python:${PYTHON_VERSION}-build as builder
ARG PKG
ARG PKG_VERSION
ARG ARCH
ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
RUN if [ ${ARCH} = "armv7hf" ] ; then [ "cross-build-start" ] ; fi
RUN pip3 install wheel \
&& pip3 wheel ${PKG}==${PKG_VERSION} --wheel-dir=/tmp/build-${PKG}
RUN if [ ${ARCH} = "armv7hf" ] ; then [ "cross-build-end" ] ; fi
FROM balenalib/${ARCH}-debian-python:${PYTHON_VERSION}
ARG PKG
ARG ARCH
COPY --from=builder /tmp/build-${PKG} /tmp/build-${PKG}
WORKDIR /tmp/build-${PKG}
RUN if [ ${ARCH} = "armv7hf" ] ; then [ "cross-build-start" ] ; fi
RUN pip3 install --no-index --find-links=/tmp/build-${PKG} ${PKG} \
&& rm -rf /tmp/build-${PKG}
RUN useradd -m ${PKG}
RUN if [ ${ARCH} = "armv7hf" ] ; then [ "cross-build-end" ] ; fi
USER ${PKG}
WORKDIR /
ENTRYPOINT [ "oci" ]