Skip to content

Commit

Permalink
Add support for arm64 (#8)
Browse files Browse the repository at this point in the history
* Target multi-platform

* Start from mysql/mysql-server image

* Download aws-cli binary instead of pip
  • Loading branch information
lens0021 authored Apr 17, 2021
1 parent 2e7ee7a commit c034514
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
steps:
# don't need to use the actions/checkout when using setup-buildx-action

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

Expand All @@ -31,6 +34,7 @@ jobs:
uses: docker/build-push-action@v2
with:
cache-from: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
platforms: linux/amd64,linux/arm64
push: ${{ github.repository_owner == 'femiwiki' }}
tags: |
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
Expand Down
20 changes: 11 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#
# Build
#
FROM mysql:8
FROM --platform=$TARGETPLATFORM mysql/mysql-server:8.0.23
ARG TARGETPLATFORM

WORKDIR /a

Expand All @@ -12,26 +13,27 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Add Tini
# See https://github.com/krallin/tini for the further details
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN PLATFORM="$(echo $TARGETPLATFORM | cut -d/ -f2)" &&\
curl -sLfo /tini "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${PLATFORM}"
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]

# Install cron
RUN apt-get update && apt-get -y install cron
RUN yum install -y cronie

# Register a cronjob
COPY crontab .
RUN crontab crontab && rm crontab

# Install php
RUN apt-get update && apt-get install -y php-cli

# Install python
RUN apt-get update && apt-get install -y python3-pip
RUN yum install -y php-cli

# Install AWS CLI
RUN python3 -m pip install --upgrade pip &&\
python3 -m pip install awscli
RUN yum install -y unzip
RUN curl -sLfo awscli.zip "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -p).zip" &&\
unzip awscli.zip &&\
./aws/install &&\
rm -rf awscli ./aws

# Copy scripts
COPY do-backup docker-cmd /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion docker-cmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ single-transaction
EOF

touch /tmp/log
cron
crond
tail -f /tmp/log

0 comments on commit c034514

Please sign in to comment.