Skip to content

Commit 5ad1141

Browse files
committed
switch to scratch image
1 parent feb571f commit 5ad1141

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ jobs:
5858
id: buildx
5959
uses: docker/setup-buildx-action@v1
6060
- name: Login to DockerHub
61-
uses: docker/login-action@v1
61+
uses: docker/login-action@v2
6262
with:
63-
username: ${{ secrets.DOCKERHUB_USERNAME }}
63+
username: jpillora
6464
password: ${{ secrets.DOCKERHUB_TOKEN }}
6565
- name: Docker meta
6666
id: docker_meta

Dockerfile

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# build stage
2-
FROM golang:1.19 as build
3-
LABEL maintainer="[email protected]"
4-
ENV CGO_ENABLED 0
2+
FROM golang:alpine AS build
3+
RUN apk update && apk add git
54
ADD . /src
65
WORKDIR /src
7-
RUN go mod download
6+
ENV CGO_ENABLED 0
87
RUN go build \
98
-ldflags "-X github.com/jpillora/chisel/share.BuildVersion=$(git describe --abbrev=0 --tags)" \
10-
-o chisel
9+
-o /tmp/bin
1110
# run stage
1211
FROM scratch
13-
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
12+
LABEL maintainer="[email protected]"
13+
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
1414
WORKDIR /app
15-
COPY --from=build /src/chisel /app/chisel
16-
ENTRYPOINT ["/app/chisel"]
15+
COPY --from=build /tmp/bin /app/bin
16+
ENTRYPOINT ["/app/bin"]

0 commit comments

Comments
 (0)