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