Skip to content

Commit

Permalink
Merge pull request #681 from vholer/gh-490
Browse files Browse the repository at this point in the history
Build and release Moco controller/backup images for arm64
  • Loading branch information
takara9 authored Jun 6, 2024
2 parents b5c10bb + 0bea03f commit ec7d627
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -37,7 +37,7 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
push: true
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
target: controller
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -76,7 +76,7 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
push: true
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ FROM --platform=$TARGETPLATFORM ghcr.io/cybozu-go/moco/mysql:8.0.37.1 as mysql
FROM --platform=$TARGETPLATFORM ghcr.io/cybozu/ubuntu:22.04
LABEL org.opencontainers.image.source https://github.com/cybozu-go/moco

ARG MYSQLSH_VERSION=8.0.37-1
ARG MYSQLSH_VERSION=8.0.37
ARG MYSQLSH_GLIBC_VERSION=2.28
ARG TARGETARCH

COPY --from=builder /work/moco-backup /moco-backup

Expand All @@ -37,10 +39,13 @@ COPY --from=mysql /usr/local/mysql/bin/mysql /usr/local/mysql/bin/mysql
RUN apt-get update \
&& apt-get install -y --no-install-recommends libjemalloc2 zstd python3 libpython3.10 s3cmd \
&& rm -rf /var/lib/apt/lists/* \
&& curl -o /tmp/mysqlsh.deb -fsL https://dev.mysql.com/get/Downloads/MySQL-Shell/mysql-shell_${MYSQLSH_VERSION}ubuntu22.04_amd64.deb \
&& dpkg -i /tmp/mysqlsh.deb \
&& rm -f /tmp/mysqlsh.deb

ENV PATH=/usr/local/mysql/bin:"$PATH"
&& if [ "${TARGETARCH}" = 'amd64' ]; then MYSQLSH_ARCH='x86-64'; fi \
&& if [ "${TARGETARCH}" = 'arm64' ]; then MYSQLSH_ARCH='arm-64'; fi \
&& curl -o /tmp/mysqlsh.tar.gz -fsL "https://cdn.mysql.com//Downloads/MySQL-Shell/mysql-shell-${MYSQLSH_VERSION}-linux-glibc${MYSQLSH_GLIBC_VERSION}-${MYSQLSH_ARCH:-unknown}bit.tar.gz" \
&& mkdir /usr/local/mysql-shell \
&& tar -xf /tmp/mysqlsh.tar.gz -C /usr/local/mysql-shell --strip-components=1 \
&& rm -f /tmp/mysqlsh.tar.gz

ENV PATH=/usr/local/mysql/bin:/usr/local/mysql-shell/bin:"$PATH"
USER 10000:10000
ENTRYPOINT ["/moco-backup"]

0 comments on commit ec7d627

Please sign in to comment.