mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-09 05:59:50 +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:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
tags:
|
||||||
|
- "*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
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
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
@ -26,6 +35,10 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
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
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
@ -33,4 +46,4 @@ jobs:
|
|||||||
file: ./Dockerfile_build
|
file: ./Dockerfile_build
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
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
|
vendor
|
||||||
pb_data
|
pb_data
|
||||||
main
|
main
|
||||||
./certimate
|
certimate
|
||||||
build
|
build
|
||||||
/docker/data
|
/docker/data
|
||||||
|
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
FROM golang:1.22-alpine
|
FROM alpine:3.20
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY ../. /app/
|
COPY certimate /app/certimate
|
||||||
|
|
||||||
RUN go build -o certimate
|
|
||||||
|
|
||||||
ENTRYPOINT ["./certimate", "serve", "--http", "0.0.0.0:8090"]
|
ENTRYPOINT ["./certimate", "serve", "--http", "0.0.0.0:8090"]
|
Loading…
x
Reference in New Issue
Block a user