Skip to content

Commit

Permalink
Merge pull request #58 from amazeeio/multiarch
Browse files Browse the repository at this point in the history
build: enable multiarch images
  • Loading branch information
shreddedbacon authored Dec 23, 2024
2 parents 1541723 + 1b0062c commit f84c807
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 46 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,44 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
amazeeio/dbaas-operator
ghcr.io/amazeeio/dbaas-operator
${{ github.repository_owner }}/dbaas-operator
ghcr.io/${{ github.repository_owner }}/dbaas-operator
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
12 changes: 6 additions & 6 deletions .github/workflows/dbaas-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
experimental: true
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Setup correct Go version
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: '1.16'
- name: Install kustomize, kubebuilder, helm
Expand All @@ -42,7 +42,7 @@ jobs:
curl -sL https://get.helm.sh/helm-v3.6.3-linux-amd64.tar.gz | tar -xz -C /tmp/
sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm
chmod +x /usr/local/bin/helm
- name: Check go, kustomize, kubebuilder, helm, docker-compose, kind versions
- name: Check go, kustomize, kubebuilder, helm, docker compose, kind versions
run: |
go version
kustomize version
Expand All @@ -55,13 +55,13 @@ jobs:
node_image: kindest/node:${{ matrix.kindest_node_version }}
# config: test-resources/kind-config.yaml
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: amazeeio/dbaas-operator:test-tag
- name: Run Tests
run: |
make operator-test
make operator-test
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COPY controllers/ controllers/
COPY handlers/ handlers/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} GO111MODULE=on go build -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ operator-test:
./operator-test.sh

clean:
docker-compose down
docker compose down
kind delete cluster --name ${KIND_NAME}

local-circle:
Expand Down
Loading

0 comments on commit f84c807

Please sign in to comment.