Dockerhub Multiarch Build #80
6 changed files with 109 additions and 0 deletions
17
amd64.dockerfile
Normal file
17
amd64.dockerfile
Normal 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
26
arm32v5.dockerfile
Normal 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
26
arm32v7.dockerfile
Normal 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
26
arm64v8.dockerfile
Normal 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
9
hooks/post_push
Normal 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
5
hooks/pre_build
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue