Skip to content

Try creating builder #7

Try creating builder

Try creating builder #7

Workflow file for this run

name: Build Preview Images
on:
push:
branches: "preview-images"
#tags:
# - "*"
env:
IMAGE_NAME: "synadia/nats-server"
jobs:
linux_2_10:
#if: ${{ startsWith(github.ref_name, '2.10.') }}
if: ${{ startsWith(github.ref_name, 'preview-images') }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# Setting up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Setup builder
run: |
docker buildx create --name builder --bootstrap --use
- name: Alpine image
run: |
docker buildx build \
--platform linux/arm64,linux/arm/v6,linux/arm/v7,linux/amd64,linux/386,linux/s390x \
--tag "${{ env.IMAGE_NAME }}:${{ github.ref_name }}-alpine3.19" \
--push \
./2.10.x/alpine3.19
- name: Scratch image
run: |
docker buildx build \
--build-arg "BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ github.ref_name }}-alpine3.19" \
--platform linux/arm64,linux/arm/v6,linux/arm/v7,linux/amd64,linux/386,linux/s390x \
--tag "${{ env.IMAGE_NAME }}:${{ github.ref_name }}-scratch" \
--push \
./2.10.x/scratch