Skip to content

Add arm64 build

Add arm64 build #69

name: Docker Image
on:
push:
tags:
- '**'
branches:
- master
pull_request:
paths:
- .github/workflows/jaeger-dockerimage.yml
- Dockerfile
- protoc-wrapper
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build (and maybe Publish) the Docker image
run: |
push=false
platforms="linux/amd64,linux/arm64"
namespace="jaegertracing"
component_name='protobuf'
if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then
IMAGE_TAGS=("--tag" "${namespace}/${component_name}:latest")
push=true
elif [[ "${GITHUB_REF}" =~ refs/tags/v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
TAG="${GITHUB_REF#"refs/tags/v"}"
IMAGE_TAGS=("--tag" "${namespace}/${component_name}:latest" "--tag" "${namespace}/${component_name}:${TAG}")
push=true
else
IMAGE_TAGS=("--tag" "${namespace}/${component_name}:${GITHUB_REF#"refs/tags/"}")
fi
if [[ $push == true ]]; then
output="type=image, push=true"
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
else
output="type=image"
fi
docker buildx build --output "type=image, push=true" \
--progress=plain \
--platform="${platforms}" \
--file Dockerfile \
"${IMAGE_TAGS[@]}" \
.