chore(docker): use standalone dockerfiles for multiarch

This commit is contained in:
Robert Kaussow 2020-12-26 18:04:08 +01:00
parent bc7cddb9cc
commit a78300cc3b
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
5 changed files with 68 additions and 14 deletions

View File

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

View File

@ -234,7 +234,7 @@ steps:
settings:
config:
from_secret: docker_config
dockerfile: docker/Dockerfile
dockerfile: docker/Dockerfile.amd64
dry_run: true
password:
from_secret: docker_password
@ -254,7 +254,7 @@ steps:
auto_tag_suffix: amd64
config:
from_secret: docker_config
dockerfile: docker/Dockerfile
dockerfile: docker/Dockerfile.amd64
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
@ -274,7 +274,7 @@ steps:
auto_tag_suffix: amd64
config:
from_secret: docker_config
dockerfile: docker/Dockerfile
dockerfile: docker/Dockerfile.amd64
password:
from_secret: quay_password
registry: quay.io
@ -321,7 +321,7 @@ steps:
settings:
config:
from_secret: docker_config
dockerfile: docker/Dockerfile
dockerfile: docker/Dockerfile.arm64
dry_run: true
password:
from_secret: docker_password
@ -341,7 +341,7 @@ steps:
auto_tag_suffix: arm64
config:
from_secret: docker_config
dockerfile: docker/Dockerfile
dockerfile: docker/Dockerfile.arm64
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
@ -361,7 +361,7 @@ steps:
auto_tag_suffix: arm64
config:
from_secret: docker_config
dockerfile: docker/Dockerfile
dockerfile: docker/Dockerfile.arm64
password:
from_secret: quay_password
registry: quay.io
@ -408,7 +408,7 @@ steps:
settings:
config:
from_secret: docker_config
dockerfile: docker/Dockerfile
dockerfile: docker/Dockerfile.arm
dry_run: true
password:
from_secret: docker_password
@ -428,7 +428,7 @@ steps:
auto_tag_suffix: arm
config:
from_secret: docker_config
dockerfile: docker/Dockerfile
dockerfile: docker/Dockerfile.arm
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
@ -448,7 +448,7 @@ steps:
auto_tag_suffix: arm
config:
from_secret: docker_config
dockerfile: docker/Dockerfile
dockerfile: docker/Dockerfile.arm
password:
from_secret: quay_password
registry: quay.io
@ -664,6 +664,6 @@ depends_on:
---
kind: signature
hmac: efe34a2b218e5db05f9608c0ab25e90352a70bcaaf802a6419d192dda8ac0cdc
hmac: 97c4c2ccaed65fc776fe84a4c5f5008123f526ce587c03c93d2c89eb27b66d49
...

View File

@ -1,4 +1,4 @@
FROM python:3.9-alpine
FROM amd64/python:3.9-alpine
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"

27
docker/Dockerfile.arm Normal file
View File

@ -0,0 +1,27 @@
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="docker-tidy"
LABEL org.opencontainers.image.url="https://docker-tidy.geekdocs.de/"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/docker-tidy"
LABEL org.opencontainers.image.documentation="https://docker-tidy.geekdocs.de/"
ENV PY_COLORS=1
ENV TZ=UTC
ADD dist/docker_tidy-*.whl /
RUN \
apk --update add --virtual .build-deps gcc g++ && \
pip install --upgrade --no-cache-dir pip && \
pip install --no-cache-dir docker_tidy-*.whl && \
apk del .build-deps && \
rm -f docker_tidy-*.whl && \
rm -rf /var/cache/apk/* && \
rm -rf /root/.cache/ && \
rm -rf /tmp/*
USER root
CMD []
ENTRYPOINT ["/usr/local/bin/docker-tidy", "gc"]

27
docker/Dockerfile.arm64 Normal file
View File

@ -0,0 +1,27 @@
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="docker-tidy"
LABEL org.opencontainers.image.url="https://docker-tidy.geekdocs.de/"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/docker-tidy"
LABEL org.opencontainers.image.documentation="https://docker-tidy.geekdocs.de/"
ENV PY_COLORS=1
ENV TZ=UTC
ADD dist/docker_tidy-*.whl /
RUN \
apk --update add --virtual .build-deps gcc g++ && \
pip install --upgrade --no-cache-dir pip && \
pip install --no-cache-dir docker_tidy-*.whl && \
apk del .build-deps && \
rm -f docker_tidy-*.whl && \
rm -rf /var/cache/apk/* && \
rm -rf /root/.cache/ && \
rm -rf /tmp/*
USER root
CMD []
ENTRYPOINT ["/usr/local/bin/docker-tidy", "gc"]