File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8787 username : ${{ secrets.DOCKER_USERNAME }}
8888 password : ${{ secrets.DOCKER_PASSWORD }}
8989
90+ # Enable QEMU so amd64 runner can build arm64 too
91+ - name : Set up QEMU
92+ uses : docker/setup-qemu-action@v2
93+
9094 - name : Set up Docker Buildx
9195 uses : docker/setup-buildx-action@v2 # Set up Docker Buildx for advanced building
9296
@@ -102,6 +106,8 @@ jobs:
102106 context : modules/docker/mongodb # Path to the directory with the Dockerfile
103107 file : modules/docker/mongodb/Docker/dockerfile # Path to the Dockerfile
104108 push : true # Push the image to Docker Hub
109+ # Multi-arch only for mongodb
110+ platforms : linux/amd64,linux/arm64
105111 tags : ${{ secrets.DOCKER_USERNAME }}/mongodb:latest # Tag for the Docker image
106112 build-args : |
107113 DOCKER_REGISTRY_CACHE=${{ vars.DOCKER_REGISTRY_CACHE }}
Original file line number Diff line number Diff line change 9494 username : ${{ secrets.DOCKER_USERNAME }} # Ensure this secret is set
9595 password : ${{ secrets.DOCKER_PASSWORD }} # Ensure this secret is set
9696
97+ # Enable QEMU so amd64 runner can build arm64 too
98+ - name : Set up QEMU
99+ uses : docker/setup-qemu-action@v2
100+
97101 - name : Set up Docker Buildx
98102 uses : docker/setup-buildx-action@v2 # Set up Docker Buildx for advanced building
99103
@@ -109,6 +113,8 @@ jobs:
109113 context : modules/docker/mongodb # Path to the directory with the Dockerfile
110114 file : modules/docker/mongodb/Docker/dockerfile # Path to the Dockerfile
111115 push : true # Push the image to Docker Hub
116+ # Multi-arch only for mongodb
117+ platforms : linux/amd64,linux/arm64
112118 tags : ${{ secrets.DOCKER_USERNAME }}/mongodb:latest # Tag for the Docker image
113119 build-args : |
114120 DOCKER_REGISTRY_CACHE=${{ vars.DOCKER_REGISTRY_CACHE }}
Original file line number Diff line number Diff line change 11ARG DOCKER_REGISTRY_CACHE
22ARG IMAGE_OPENSUSELEAP
33FROM $DOCKER_REGISTRY_CACHE/$IMAGE_OPENSUSELEAP
4+ ARG TARGETARCH
5+ ARG TARGETOS
6+ ENV TARGETARCH=${TARGETARCH}
7+ ENV TARGETOS=${TARGETOS}
8+
49
510# Expose MongoDB port
611EXPOSE 27017
Original file line number Diff line number Diff line change 11#! /bin/bash
22cd $project_path /modules/docker/mongodb
3- docker compose up -d --build --force-recreate
3+ case " $1 " in
4+ arm)
5+ echo " [mongodb] Starting in ARM64 mode..."
6+ export DOCKER_DEFAULT_PLATFORM=linux/arm64
7+ export DOCKER_BUILDKIT=1
8+ export COMPOSE_DOCKER_CLI_BUILD=1
9+ docker compose up -d --build --force-recreate
10+ ;;
11+ * )
12+ echo " [mongodb] Starting in native amd64 mode..."
13+ docker compose up -d --build --force-recreate
14+ unset DOCKER_DEFAULT_PLATFORM
15+ unset DOCKER_BUILDKIT
16+ unset COMPOSE_DOCKER_CLI_BUILD
17+ ;;
18+ esac
419cd
You can’t perform that action at this time.
0 commit comments