Dockerhub Multiarch Build #80

Merged
bmartin5692 merged 8 commits from add-79-docker-multiarch into master 2019-12-31 22:29:37 +01:00
6 changed files with 109 additions and 0 deletions
Showing only changes of commit 4f820ebce8 - Show all commits

17
amd64.dockerfile Normal file
View file

@ -0,0 +1,17 @@
FROM amd64/python:3.7-alpine as base
FROM base as builder
# add build utils (gcc, others)
RUN apk add build-base
FROM base
COPY . /bumper
WORKDIR /bumper
# install required python packages
RUN pip3 install -r requirements.txt
ENTRYPOINT ["python3", "-m", "bumper"]

26
arm32v5.dockerfile Normal file
View file

@ -0,0 +1,26 @@
FROM alpine as builder
# Download QEMU, see https://github.com/docker/hub-feedback/issues/1261
ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz
RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . --strip-components 1
FROM arm32v5/python:3.7-alpine as base
# Add QEMU
COPY --from=builder qemu-arm-static /usr/bin
FROM base as builder
# add build utils (gcc, others)
RUN apk add build-base
FROM base
COPY . /bumper
WORKDIR /bumper
# install required python packages
RUN pip3 install -r requirements.txt
ENTRYPOINT ["python3", "-m", "bumper"]

26
arm32v7.dockerfile Normal file
View file

@ -0,0 +1,26 @@
FROM alpine as builder
# Download QEMU, see https://github.com/docker/hub-feedback/issues/1261
ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz
RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . --strip-components 1
FROM arm32v7/python:3.7-alpine as base
# Add QEMU
COPY --from=builder qemu-arm-static /usr/bin
FROM base as builder
# add build utils (gcc, others)
RUN apk add build-base
FROM base
COPY . /bumper
WORKDIR /bumper
# install required python packages
RUN pip3 install -r requirements.txt
ENTRYPOINT ["python3", "-m", "bumper"]

26
arm64v8.dockerfile Normal file
View file

@ -0,0 +1,26 @@
FROM alpine as builder
# Download QEMU, see https://github.com/docker/hub-feedback/issues/1261
ENV QEMU_URL https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-aarch64.tar.gz
RUN apk add curl && curl -L ${QEMU_URL} | tar zxvf - -C . --strip-components 1
FROM arm64v8/python:3.7-alpine as base
# Add QEMU
COPY --from=builder qemu-aarch64-static /usr/bin
FROM base as builder
# add build utils (gcc, others)
RUN apk add build-base
FROM base
COPY . /bumper
WORKDIR /bumper
# install required python packages
RUN pip3 install -r requirements.txt
ENTRYPOINT ["python3", "-m", "bumper"]

9
hooks/post_push Normal file
View file

@ -0,0 +1,9 @@
#!/bin/bash
# Use manifest-tool to create the manifest, given the experimental
# "docker manifest" command isn't available yet on Docker Hub.
curl -Lo manifest-tool https://github.com/estesp/manifest-tool/releases/download/v1.0.0/manifest-tool-linux-amd64
chmod +x manifest-tool
./manifest-tool push from-spec multi-arch-manifest.yaml

5
hooks/pre_build Normal file
View file

@ -0,0 +1,5 @@
#!/bin/bash
# Register qemu-*-static for all supported processors except the
# current one, but also remove all registered binfmt_misc before
docker run --rm --privileged multiarch/qemu-user-static:register --reset