drone build with param docker-conatiner
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
34
drone.yml
34
drone.yml
@@ -2,11 +2,14 @@ kind: pipeline
|
||||
type: docker
|
||||
name: build-and-push
|
||||
|
||||
# BuildKit-Service für parallele Multiarch-Builds
|
||||
services:
|
||||
- name: buildkitd
|
||||
image: moby/buildkit:buildx-stable-1
|
||||
privileged: true
|
||||
command: ["buildkitd", "--addr", "tcp://0.0.0.0:1234", "--debug"]
|
||||
# Netzwerk explizit öffnen
|
||||
network_mode: host
|
||||
|
||||
steps:
|
||||
- name: build-amd64
|
||||
@@ -25,14 +28,15 @@ steps:
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- |
|
||||
echo "Building amd64 image..."
|
||||
docker login $REGISTRY_URL -u "$DOCKER_USER" -p "$DOCKER_PASS"
|
||||
docker buildx create --use --driver remote --driver-opt network=host tcp://buildkitd:1234
|
||||
echo "=== Building amd64 image ==="
|
||||
docker login "$REGISTRY_URL" -u "$DOCKER_USER" -p "$DOCKER_PASS"
|
||||
docker buildx create --use --driver docker-container --driver-opt network=host
|
||||
docker buildx inspect --bootstrap
|
||||
docker buildx build \
|
||||
--platform linux/amd64 \
|
||||
--output=type=registry \
|
||||
--provenance=false \
|
||||
-t registry.buchhorster.de/portainer-agent-tailscale:amd64 \
|
||||
-t ${REGISTRY_URL}/portainer-agent-tailscale:amd64 \
|
||||
--push .
|
||||
|
||||
- name: build-arm64
|
||||
@@ -51,21 +55,21 @@ steps:
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- |
|
||||
echo "Building arm64 image..."
|
||||
docker login $REGISTRY_URL -u "$DOCKER_USER" -p "$DOCKER_PASS"
|
||||
docker buildx create --use --driver remote --driver-opt network=host tcp://buildkitd:1234
|
||||
echo "=== Building arm64 image ==="
|
||||
docker login "$REGISTRY_URL" -u "$DOCKER_USER" -p "$DOCKER_PASS"
|
||||
docker buildx create --use --driver docker-container --driver-opt network=host
|
||||
docker buildx inspect --bootstrap
|
||||
docker buildx build \
|
||||
--platform linux/arm64 \
|
||||
--output=type=registry \
|
||||
--provenance=false \
|
||||
-t registry.buchhorster.de/portainer-agent-tailscale:arm64 \
|
||||
-t ${REGISTRY_URL}/portainer-agent-tailscale:arm64 \
|
||||
--push .
|
||||
|
||||
- name: create-manifest
|
||||
image: docker:26
|
||||
privileged: true
|
||||
environment:
|
||||
BUILDKIT_HOST: tcp://buildkitd:1234
|
||||
REGISTRY_URL:
|
||||
from_secret: REGISTRY_URL
|
||||
DOCKER_USER:
|
||||
@@ -77,12 +81,12 @@ steps:
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- |
|
||||
echo "Creating multi-arch manifest..."
|
||||
docker login $REGISTRY_URL -u "$DOCKER_USER" -p "$DOCKER_PASS"
|
||||
docker manifest create registry.buchhorster.de/portainer-agent-tailscale:latest \
|
||||
--amend registry.buchhorster.de/portainer-agent-tailscale:amd64 \
|
||||
--amend registry.buchhorster.de/portainer-agent-tailscale:arm64
|
||||
docker manifest push registry.buchhorster.de/portainer-agent-tailscale:latest
|
||||
echo "=== Creating multi-arch manifest ==="
|
||||
docker login "$REGISTRY_URL" -u "$DOCKER_USER" -p "$DOCKER_PASS"
|
||||
docker manifest create ${REGISTRY_URL}/portainer-agent-tailscale:latest \
|
||||
--amend ${REGISTRY_URL}/portainer-agent-tailscale:amd64 \
|
||||
--amend ${REGISTRY_URL}/portainer-agent-tailscale:arm64
|
||||
docker manifest push ${REGISTRY_URL}/portainer-agent-tailscale:latest
|
||||
|
||||
volumes:
|
||||
- name: docker_sock
|
||||
|
||||
Reference in New Issue
Block a user