Skip to content

Commit

Permalink
Fix docker build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
matsuu committed Dec 24, 2023
1 parent d1d6809 commit 9c1df64
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/metadata-action@v4
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/metadata-action@v5
id: meta
with:
images: |
Expand All @@ -19,23 +19,24 @@ jobs:
latest=true
tags: |
type=match,pattern=v(.*),group=1
- uses: docker/login-action@v2
- uses: docker/login-action@v3
if: github.ref_type == 'tag'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/login-action@v2
- uses: docker/login-action@v3
if: github.ref_type == 'tag'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
- uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BRANCH=${{ github.ref_type == 'tag' && steps.meta.output.ref_name || '3.x' }}
cache-from: type=gha
cache-to: type=gha,mode=max
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
FROM alpine:latest

ADD http://percona.com/get/percona-toolkit.tar.gz /
ARG BRANCH=3.x

RUN \
apk update && \
apk add perl perl-dbd-mysql && \
apk add --virtual=build make && \
tar zxf /percona-toolkit.tar.gz && \
apk add --virtual=build git go make && \
git clone https://github.com/percona/percona-toolkit.git && \
( \
cd percona-toolkit-* && \
cd percona-toolkit && \
git checkout ${BRANCH} && \
perl Makefile.PL && \
make && \
make install \
) && \
rm -rf percona-toolkit* && \
rm -rf percona-toolkit && \
apk del --purge build

ENTRYPOINT ["pt-query-digest"]

0 comments on commit 9c1df64

Please sign in to comment.