mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 05:29:51 +00:00
To optimize Docker image size.
This commit is contained in:
parent
51d5c24ef3
commit
48bcd32268
17
.github/workflows/push_image.yml
vendored
17
.github/workflows/push_image.yml
vendored
@ -2,13 +2,22 @@ name: Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ">=1.22.5"
|
||||
|
||||
- name: Build certimate
|
||||
run: go build -o certimate
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@ -26,6 +35,10 @@ jobs:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Extract Git tag
|
||||
id: get_tag
|
||||
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
@ -33,4 +46,4 @@ jobs:
|
||||
file: ./Dockerfile_build
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: registry.cn-shanghai.aliyuncs.com/usual2970/certimate:latest
|
||||
tags: registry.cn-shanghai.aliyuncs.com/usual2970/certimate:${{ env.tag }}
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,7 +2,7 @@ __debug_bin*
|
||||
vendor
|
||||
pb_data
|
||||
main
|
||||
./certimate
|
||||
certimate
|
||||
build
|
||||
/docker/data
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
FROM golang:1.22-alpine
|
||||
FROM alpine:3.20
|
||||
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY ../. /app/
|
||||
|
||||
RUN go build -o certimate
|
||||
COPY certimate /app/certimate
|
||||
|
||||
ENTRYPOINT ["./certimate", "serve", "--http", "0.0.0.0:8090"]
|
Loading…
x
Reference in New Issue
Block a user