chore(docker): use standalone dockerfiles for multiarch

This commit is contained in:
Robert Kaussow 2021-01-03 20:53:56 +01:00
parent ae4302f706
commit 8e93fcdcce
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
7 changed files with 88 additions and 44 deletions

View File

@ -209,7 +209,7 @@ local PipelineBuildContainer(arch='amd64') = {
settings: { settings: {
config: { from_secret: 'docker_config' }, config: { from_secret: 'docker_config' },
dry_run: true, dry_run: true,
dockerfile: 'docker/Dockerfile', dockerfile: 'docker/Dockerfile.' + arch,
repo: 'thegeeklab/git-batch', repo: 'thegeeklab/git-batch',
username: { from_secret: 'docker_username' }, username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' }, password: { from_secret: 'docker_password' },
@ -226,7 +226,7 @@ local PipelineBuildContainer(arch='amd64') = {
config: { from_secret: 'docker_config' }, config: { from_secret: 'docker_config' },
auto_tag: true, auto_tag: true,
auto_tag_suffix: arch, auto_tag_suffix: arch,
dockerfile: 'docker/Dockerfile', dockerfile: 'docker/Dockerfile.' + arch,
repo: 'thegeeklab/${DRONE_REPO_NAME}', repo: 'thegeeklab/${DRONE_REPO_NAME}',
username: { from_secret: 'docker_username' }, username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' }, password: { from_secret: 'docker_password' },
@ -243,7 +243,7 @@ local PipelineBuildContainer(arch='amd64') = {
config: { from_secret: 'docker_config' }, config: { from_secret: 'docker_config' },
auto_tag: true, auto_tag: true,
auto_tag_suffix: arch, auto_tag_suffix: arch,
dockerfile: 'docker/Dockerfile', dockerfile: 'docker/Dockerfile.' + arch,
registry: 'quay.io', registry: 'quay.io',
repo: 'quay.io/thegeeklab/${DRONE_REPO_NAME}', repo: 'quay.io/thegeeklab/${DRONE_REPO_NAME}',
username: { from_secret: 'quay_username' }, username: { from_secret: 'quay_username' },

View File

@ -233,7 +233,7 @@ steps:
settings: settings:
config: config:
from_secret: docker_config from_secret: docker_config
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile.amd64
dry_run: true dry_run: true
password: password:
from_secret: docker_password from_secret: docker_password
@ -253,7 +253,7 @@ steps:
auto_tag_suffix: amd64 auto_tag_suffix: amd64
config: config:
from_secret: docker_config from_secret: docker_config
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile.amd64
password: password:
from_secret: docker_password from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME} repo: thegeeklab/${DRONE_REPO_NAME}
@ -273,7 +273,7 @@ steps:
auto_tag_suffix: amd64 auto_tag_suffix: amd64
config: config:
from_secret: docker_config from_secret: docker_config
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile.amd64
password: password:
from_secret: quay_password from_secret: quay_password
registry: quay.io registry: quay.io
@ -322,7 +322,7 @@ steps:
settings: settings:
config: config:
from_secret: docker_config from_secret: docker_config
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile.arm64
dry_run: true dry_run: true
password: password:
from_secret: docker_password from_secret: docker_password
@ -342,7 +342,7 @@ steps:
auto_tag_suffix: arm64 auto_tag_suffix: arm64
config: config:
from_secret: docker_config from_secret: docker_config
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile.arm64
password: password:
from_secret: docker_password from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME} repo: thegeeklab/${DRONE_REPO_NAME}
@ -362,7 +362,7 @@ steps:
auto_tag_suffix: arm64 auto_tag_suffix: arm64
config: config:
from_secret: docker_config from_secret: docker_config
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile.arm64
password: password:
from_secret: quay_password from_secret: quay_password
registry: quay.io registry: quay.io
@ -411,7 +411,7 @@ steps:
settings: settings:
config: config:
from_secret: docker_config from_secret: docker_config
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile.arm
dry_run: true dry_run: true
password: password:
from_secret: docker_password from_secret: docker_password
@ -431,7 +431,7 @@ steps:
auto_tag_suffix: arm auto_tag_suffix: arm
config: config:
from_secret: docker_config from_secret: docker_config
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile.arm
password: password:
from_secret: docker_password from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME} repo: thegeeklab/${DRONE_REPO_NAME}
@ -451,7 +451,7 @@ steps:
auto_tag_suffix: arm auto_tag_suffix: arm
config: config:
from_secret: docker_config from_secret: docker_config
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile.arm
password: password:
from_secret: quay_password from_secret: quay_password
registry: quay.io registry: quay.io
@ -575,6 +575,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: 4e584a0541cf28a67c24b61a955fcfeacd37a768a8f99f280b1dc572501fe5d3 hmac: 595b9f73481481804eb918efee5275483a9b3d147e0d3ac6b70e49a844f11c90
... ...

View File

@ -1,7 +0,0 @@
#!/usr/bin/env python3
import sys
import gitbatch.__main__
sys.exit(gitbatch.__main__.main())

View File

@ -1,24 +0,0 @@
FROM python:3.9-alpine
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>" \
org.label-schema.name="git-batch" \
org.label-schema.vcs-url="https://github.com/thegeeklab/git-batch" \
org.label-schema.vendor="Robert Kaussow" \
org.label-schema.schema-version="1.0"
ENV PY_COLORS=1
ADD dist/git_batch-*.whl /
RUN apk --update add --virtual .build-deps build-base libffi-dev libressl-dev && \
apk --update add git && \
pip install --upgrade --no-cache-dir pip && \
pip install --no-cache-dir git_batch-*.whl && \
apk del .build-deps && \
rm -f git_batch-*.whl && \
rm -rf /var/cache/apk/* && \
rm -rf /root/.cache/
USER root
CMD []
ENTRYPOINT ["/usr/local/bin/git-batch"]

25
docker/Dockerfile.amd64 Normal file
View File

@ -0,0 +1,25 @@
FROM amd64/python:3.9-alpine
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.title="git-batch"
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/git-batch"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/git-batch"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/git-batch"
ENV PY_COLORS=1
ADD dist/git_batch-*.whl /
RUN apk --update add --virtual .build-deps build-base libffi-dev libressl-dev && \
apk --update add git && \
pip install --upgrade --no-cache-dir pip && \
pip install --no-cache-dir $(find / -name "git_batch-*.whl") && \
apk del .build-deps && \
rm -f git_batch-*.whl && \
rm -rf /var/cache/apk/* && \
rm -rf /root/.cache/
USER root
CMD []
ENTRYPOINT ["/usr/local/bin/git-batch"]

25
docker/Dockerfile.arm Normal file
View File

@ -0,0 +1,25 @@
FROM arm32v7/python:3.9-alpine
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.title="git-batch"
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/git-batch"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/git-batch"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/git-batch"
ENV PY_COLORS=1
ADD dist/git_batch-*.whl /
RUN apk --update add --virtual .build-deps build-base libffi-dev libressl-dev && \
apk --update add git && \
pip install --upgrade --no-cache-dir pip && \
pip install --no-cache-dir $(find / -name "git_batch-*.whl") && \
apk del .build-deps && \
rm -f git_batch-*.whl && \
rm -rf /var/cache/apk/* && \
rm -rf /root/.cache/
USER root
CMD []
ENTRYPOINT ["/usr/local/bin/git-batch"]

25
docker/Dockerfile.arm64 Normal file
View File

@ -0,0 +1,25 @@
FROM arm64v8/python:3.9-alpine
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.title="git-batch"
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/git-batch"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/git-batch"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/git-batch"
ENV PY_COLORS=1
ADD dist/git_batch-*.whl /
RUN apk --update add --virtual .build-deps build-base libffi-dev libressl-dev && \
apk --update add git && \
pip install --upgrade --no-cache-dir pip && \
pip install --no-cache-dir $(find / -name "git_batch-*.whl") && \
apk del .build-deps && \
rm -f git_batch-*.whl && \
rm -rf /var/cache/apk/* && \
rm -rf /root/.cache/
USER root
CMD []
ENTRYPOINT ["/usr/local/bin/git-batch"]