more docker stuff
This commit is contained in:
@@ -139,24 +139,6 @@ jobs:
|
||||
username: getterup
|
||||
password: ${{ secrets.RELEASE_TOKEN }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
driver: docker
|
||||
continue-on-error: true
|
||||
|
||||
# Fallback Buildx setup if the main one fails
|
||||
- name: Fallback Docker Buildx setup
|
||||
if: failure()
|
||||
run: |
|
||||
echo "Setting up Docker Buildx manually as fallback..."
|
||||
docker buildx create --use --name fallback-builder --driver docker || true
|
||||
docker buildx inspect --bootstrap || echo "Buildx bootstrap failed, continuing..."
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
@@ -177,14 +159,32 @@ jobs:
|
||||
|
||||
- name: Build and push image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
provenance: mode=max
|
||||
sbom: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: linux/amd64
|
||||
build-args: |
|
||||
BUILD_DROP_VERSION=${{ steps.get_final_ver.outputs.final_ver }}
|
||||
run: |
|
||||
echo "Building image with docker build..."
|
||||
echo "Tags: ${{ steps.meta.outputs.tags }}"
|
||||
|
||||
# Build once with the first tag
|
||||
FIRST_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
||||
if [ -z "$FIRST_TAG" ]; then
|
||||
echo "No tags produced by metadata action"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker build \
|
||||
--build-arg BUILD_DROP_VERSION=${{ steps.get_final_ver.outputs.final_ver }} \
|
||||
-t "$FIRST_TAG" \
|
||||
.
|
||||
|
||||
# Tag remaining tags
|
||||
echo "${{ steps.meta.outputs.tags }}" | tail -n +2 | while read -r TAG; do
|
||||
if [ -n "$TAG" ]; then
|
||||
docker tag "$FIRST_TAG" "$TAG"
|
||||
fi
|
||||
done
|
||||
|
||||
# Push all tags
|
||||
echo "${{ steps.meta.outputs.tags }}" | while read -r TAG; do
|
||||
if [ -n "$TAG" ]; then
|
||||
docker push "$TAG"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user