Skip to content

Commit

Permalink
code(docker) - optimize build image
Browse files Browse the repository at this point in the history
  • Loading branch information
PxyUp committed Oct 28, 2024
1 parent e36eb05 commit 82d0bed
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker_base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Update docker base
on:
push:
paths:
- docker_base/**

jobs:
build:
name: Build docker base image
runs-on: ubuntu-22.04
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.23.0
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Release to Docker Fitter Base
run: |
DOCKER_TAG=ghcr.io/pxyup/fitter_base:latest
docker buildx build --platform linux/arm64 -f ./docker_base/Dockerfile -t ${DOCKER_TAG} .
docker login ghcr.io --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.TOKEN }} && docker push ${DOCKER_TAG}
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
FROM --platform=linux/arm64 arm64v8/golang:1.23

ENV GOARCH=arm64
ENV GOOS=linux

RUN go run github.com/playwright-community/playwright-go/cmd/playwright@latest install --with-deps
FROM --platform=linux/arm64 ghcr.io/pxyup/fitter_base:latest

WORKDIR /go/src/fitter_cli

Expand Down
6 changes: 6 additions & 0 deletions docker_base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM --platform=linux/arm64 arm64v8/golang:1.23

ENV GOARCH=arm64
ENV GOOS=linux

RUN go run github.com/playwright-community/playwright-go/cmd/playwright@latest install --with-deps

0 comments on commit 82d0bed

Please sign in to comment.