updates for multi-arch builds
This commit is contained in:
parent
9ceef6fc1d
commit
4bc5151b3e
62
.drone.yml
62
.drone.yml
@ -1,45 +1,21 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: build
|
||||
|
||||
trigger:
|
||||
event: [ push ]
|
||||
branch: [ master ]
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
# 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
|
||||
kind: template
|
||||
load: multiarch-container.yaml
|
||||
data:
|
||||
repo: images/docker
|
||||
# because this *is* the docker image, the "latest" tag hasn't been published yet (that's
|
||||
# what we're about to do), so we need to pick a specific arch image.
|
||||
# todo: is there some way to choose this value automatically to match the runner?
|
||||
docker_image_tag: latest-linux-arm64
|
||||
build_args:
|
||||
# `apk info docker` to get latest version
|
||||
- DOCKER_VERSION=20.10.21-r1
|
||||
tags:
|
||||
- "ci"
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: publish
|
||||
|
||||
trigger:
|
||||
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"
|
||||
- "20.10.21"
|
||||
- "20.10"
|
||||
- "20"
|
||||
platforms:
|
||||
- os: linux
|
||||
arch: arm64
|
||||
# - os: linux
|
||||
# arch: amd64
|
||||
|
16
Dockerfile
16
Dockerfile
@ -1,13 +1,19 @@
|
||||
|
||||
FROM alpine:3.16
|
||||
FROM alpine:3.17
|
||||
|
||||
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
|
||||
|
||||
COPY docker-setup /
|
||||
RUN chmod +x /docker-setup
|
||||
COPY docker-setup /bin/
|
||||
RUN chmod +x /bin/docker-setup
|
||||
|
||||
CMD [ "/docker-setup" ]
|
||||
CMD [ "/bin/docker-setup" ]
|
||||
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user