1
0

updates for multi-arch builds

This commit is contained in:
James Brumond 2022-12-03 20:12:54 -08:00
parent 9ceef6fc1d
commit 4bc5151b3e
Signed by: james
GPG Key ID: 24BA25B8B303B023
2 changed files with 31 additions and 49 deletions

View File

@ -1,45 +1,21 @@
--- ---
kind: pipeline kind: template
type: kubernetes load: multiarch-container.yaml
name: build data:
repo: images/docker
trigger: # because this *is* the docker image, the "latest" tag hasn't been published yet (that's
event: [ push ] # what we're about to do), so we need to pick a specific arch image.
branch: [ master ] # todo: is there some way to choose this value automatically to match the runner?
docker_image_tag: latest-linux-arm64
steps: build_args:
- name: build # `apk info docker` to get latest version
# See: https://plugins.drone.io/plugins/docker - DOCKER_VERSION=20.10.21-r1
image: plugins/docker
settings:
registry: https://gitea.internal.example.com
username: drone
password:
from_secret: gitea-internal-password
repo: gitea.internal.example.com/examples/docker
cache_from: gitea.internal.example.com/examples/docker:ci
tags: tags:
- "ci" - "20.10.21"
- "20.10"
--- - "20"
kind: pipeline platforms:
type: kubernetes - os: linux
name: publish arch: arm64
# - os: linux
trigger: # arch: amd64
event: [ promote ]
target: [ publish ]
steps:
- name: build-and-publish
# See: https://plugins.drone.io/plugins/docker
image: plugins/docker
settings:
registry: https://gitea.internal.example.com
username: drone
password:
from_secret: gitea-internal-password
repo: gitea.internal.example.com/examples/docker
cache_from: gitea.internal.example.com/examples/docker:ci
tags:
- "latest"

View File

@ -1,13 +1,19 @@
FROM alpine:3.16 FROM alpine:3.17
ENV DOCKER_HOST=unix:///var/run/docker.sock ENV DOCKER_HOST=unix:///var/run/docker.sock
RUN apk --no-cache add --update docker openrc bash ARG DOCKER_VERSION
RUN apk --no-cache add --update \
docker=$DOCKER_VERSION \
openrc \
bash
RUN rc-update add docker boot RUN rc-update add docker boot
COPY docker-setup / COPY docker-setup /bin/
RUN chmod +x /docker-setup RUN chmod +x /bin/docker-setup
CMD [ "/docker-setup" ] CMD [ "/bin/docker-setup" ]
ENTRYPOINT [ "/bin/bash", "-l", "-c" ] ENTRYPOINT [ "/bin/bash", "-l", "-c" ]