docker to use scratch

This commit is contained in:
Jaime Pillora
2023-01-28 07:59:05 +11:00
parent 4246b649e1
commit e546a6d6cb
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -21,7 +21,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Build
run: go build -v .
run: go build -v -o /dev/null .
- name: Test
run: go test -v ./...
# ================
@@ -67,7 +67,6 @@ jobs:
uses: docker/metadata-action@v4
with:
images: jpillora/chisel
tag-latest: true
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
+2 -2
View File
@@ -9,8 +9,8 @@ RUN go build \
-ldflags "-X github.com/jpillora/chisel/share.BuildVersion=$(git describe --abbrev=0 --tags)" \
-o chisel
# run stage
FROM gcr.io/distroless/static-debian11
FROM scratch
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR /app
CMD ["/app"]
COPY --from=build /src/chisel /app/chisel
ENTRYPOINT ["/app/chisel"]