This repository has been archived by the owner on Mar 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlinuxarm32v7.Dockerfile
60 lines (50 loc) · 2.53 KB
/
linuxarm32v7.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
52
53
54
55
56
57
58
59
60
# Dockerfile to build docker-compose for aarch64
FROM arm32v7/python:3.6.5-stretch as builder
# Add env
ENV LANG C.UTF-8
# Enable cross-build for aarch64
#EnableQEMU COPY qemu-arm-static /usr/bin
RUN apt-get update && apt-get install -qq --no-install-recommends unzip
# Set the versions
ARG DOCKER_COMPOSE_VER
# docker-compose requires pyinstaller 3.5 (check github.com/docker/compose/requirements-build.txt)
# If this changes, you may need to modify the version of "six" below
ENV PYINSTALLER_VER 3.5
# "six" is needed for PyInstaller. v1.11.0 is the latest as of PyInstaller 3.5
ENV SIX_VER 1.11.0
# Install dependencies
# RUN apt-get update && apt-get install -y
RUN pip install --upgrade pip
RUN pip install six==$SIX_VER
# Compile the pyinstaller "bootloader"
# https://pyinstaller.readthedocs.io/en/stable/bootloader-building.html
WORKDIR /build/pyinstallerbootloader
RUN curl -fsSL https://github.com/pyinstaller/pyinstaller/releases/download/v$PYINSTALLER_VER/PyInstaller-$PYINSTALLER_VER.tar.gz | tar xvz >/dev/null \
&& cd PyInstaller*/bootloader \
&& python3 ./waf all
# Clone docker-compose
WORKDIR /build/dockercompose
RUN curl -fsSL https://github.com/docker/compose/archive/$DOCKER_COMPOSE_VER.zip > $DOCKER_COMPOSE_VER.zip \
&& unzip $DOCKER_COMPOSE_VER.zip
# We need to patch pynacl because of https://github.com/pyca/pynacl/issues/553
COPY PyNaCl-remove-check.patch PyNaCl-remove-check.patch
RUN cd compose-$DOCKER_COMPOSE_VER && pip download --dest "/tmp/packages" -r requirements.txt -r requirements-build.txt wheel && cd .. && \
wget -qO pynacl.tar.gz https://github.com/pyca/pynacl/archive/1.3.0.tar.gz && \
echo "205adb2804eed4bc3780584e368ef2e9b8b22a7aae85323068cadd59f3c8a584 pynacl.tar.gz" | sha256sum -c - && \
mkdir pynacl && tar --strip-components=1 -xvf pynacl.tar.gz -C pynacl && rm pynacl.tar.gz && \
cd pynacl && \
git apply ../PyNaCl-remove-check.patch && \
python3 setup.py sdist && \
cp -f dist/PyNaCl-1.3.0.tar.gz /tmp/packages/ && \
cd ../compose-$DOCKER_COMPOSE_VER && rm -rf ../pynacl && \
pip install --no-index --find-links /tmp/packages -r requirements.txt -r requirements-build.txt && rm -rf /tmp/packages
RUN cd compose-$DOCKER_COMPOSE_VER \
&& echo "unknown" > compose/GITSHA \
&& pyinstaller docker-compose.spec \
&& mkdir /dist \
&& mv dist/docker-compose /dist/docker-compose
FROM arm32v7/debian:stretch-slim
COPY --from=builder /dist/docker-compose /tmp/docker-compose
# Copy out the generated binary
VOLUME /dist
CMD /bin/cp /tmp/docker-compose /dist/docker-compose