Try to fix multi-arch build
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2024-11-23 12:48:11 +01:00
parent 2ffba27f1d
commit aa8faa8b5b

View File

@@ -19,10 +19,12 @@ steps:
RESTIC_VERSION=$$(grep RESTIC_VERSION= Dockerfile|cut -d = -f 2) RESTIC_VERSION=$$(grep RESTIC_VERSION= Dockerfile|cut -d = -f 2)
podman login --username "$${REGISTRY_USERNAME}" --password "$${REGISTRY_PASSWORD}" "$${REGISTRY_SERVER}" podman login --username "$${REGISTRY_USERNAME}" --password "$${REGISTRY_PASSWORD}" "$${REGISTRY_SERVER}"
echo "== Building $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}" echo "== Building $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}"
podman build --platform linux/arm64 --platform linux/amd64 --pull-always --format docker -t $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} . podman manifest create $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
podman build --platform linux/arm64,linux/amd64 --pull-always --manifest $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} .
podman manifest inspect $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
echo "== Publishing $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}" echo "== Publishing $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}"
podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} podman manifest push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:$${RESTIC_VERSION} podman manifest push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:$${RESTIC_VERSION}
podman logout "$${REGISTRY_SERVER}" podman logout "$${REGISTRY_SERVER}"
volumes: volumes:
- name: containers - name: containers
@@ -72,31 +74,13 @@ steps:
REGISTRY_SERVER: "docker.io" REGISTRY_SERVER: "docker.io"
RELEASE_IMAGE_NAME: "docker.io/genunix/restic" RELEASE_IMAGE_NAME: "docker.io/genunix/restic"
commands: commands:
- podman login --username "$${REGISTRY_USERNAME}" --password "$${REGISTRY_PASSWORD}" "$${REGISTRY_SERVER}" - skopeo login --username "$${REGISTRY_USERNAME}" --password "$${REGISTRY_PASSWORD}" "$${REGISTRY_SERVER}"
- echo "== Promoting $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} into production" - echo "== Promoting $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} into production"
- podman pull docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} - skopeo copy --preserve-digests --multi-arch all docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:latest
- podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:latest
- podman logout "$${REGISTRY_SERVER}"
volumes: volumes:
- name: containers - name: containers
path: /var/lib/containers path: /var/lib/containers
- name: cleanup
image: mgoltzsche/podman:5.3.1
privileged: true
environment:
RELEASE_IMAGE_NAME: "docker.io/genunix/restic"
commands:
- podman rmi -f $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
- podman rmi -f $${RELEASE_IMAGE_NAME}:latest
- podman image prune -f
volumes:
- name: containers
path: /var/lib/containers
when:
branch:
- master
trigger: trigger:
event: event:
- promote - promote