Skip to content

Commit

Permalink
fix: Dockerfileをアーキテクチャ毎に分ける
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosugamea committed Nov 18, 2020
1 parent 1e769c6 commit d4e0c92
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,27 @@ jobs:
username: ${{ secrets.GCR_USER }}
password: ${{ secrets.GCR_PASS }}

- name: Build and push
- name: Build and push armv7 image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7
file: ./Dockerfile_armv7
platforms: linux/arm/v7
push: true
tags: |
ghcr.io/gochiira/${{ env.IMAGE_NAME }}:latest
ghcr.io/gochiira/${{ env.IMAGE_NAME }}:${{ github.run_number }}
cache-from: type=registry,ref=ghcr.io/gochiira/${{ env.IMAGE_NAME }}:latest
ghcr.io/gochiira/${{ env.IMAGE_NAME }}:armv7
ghcr.io/gochiira/${{ env.IMAGE_NAME }}:armv7-${{ github.run_number }}
cache-from: type=registry,ref=ghcr.io/gochiira/${{ env.IMAGE_NAME }}:armv7
cache-to: type=inline,mode=max

- name: Build and push amd64 image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile_amd64
push: true
tags: |
ghcr.io/gochiira/${{ env.IMAGE_NAME }}:amd64
ghcr.io/gochiira/${{ env.IMAGE_NAME }}:amd64-${{ github.run_number }}
cache-from: type=registry,ref=ghcr.io/gochiira/${{ env.IMAGE_NAME }}:amd64
cache-to: type=inline,mode=max
2 changes: 1 addition & 1 deletion Dockerfile → Dockerfile_amd64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Pythonイメージの取得
FROM ghcr.io/gochiira/main-backend-depends:latest
FROM ghcr.io/gochiira/main-backend-depends:amd64
# モジュールを揃える
WORKDIR /usr/local/app
COPY . .
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile_armv7
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Pythonイメージの取得
FROM ghcr.io/gochiira/main-backend-depends:armv7
WORKDIR /usr/local/app
COPY . .
# 起動環境設定
EXPOSE 5000
ENTRYPOINT [ "gunicorn", "app:app" ]
CMD [ "-c", "gunicorn_config.py" ]

0 comments on commit d4e0c92

Please sign in to comment.