Skip to content

Commit 715b0c3

Browse files
committed
Fix Docker
1 parent 1b6ce2c commit 715b0c3

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/docker-image.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919

2020
- name: Push image
2121
run: |
22+
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io
23+
-u lemon-mint --password-stdin
24+
2225
docker push ghcr.io/lemon-mint/timeserver:latest
2326
docker tag ghcr.io/lemon-mint/timeserver:latest "ghcr.io/lemon-mint/timeserver:${GITHUB_REF#refs/*/}"
2427
docker push "ghcr.io/lemon-mint/timeserver:${GITHUB_REF#refs/*/}"

Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
FROM docker.io/golang:alpine
1+
FROM docker.io/golang:alpine as build
22

33
WORKDIR /app
44
ADD . /app
5-
RUN go build -o /app/main.exe .
5+
RUN CGO_ENABLED=0 go build -v -o /app/main.exe .
66

7+
FROM gcr.io/distroless/static-debian11
8+
9+
COPY --from=build /app/main.exe /
710
EXPOSE 8080
8-
ENTRYPOINT ["/app/main.exe"]
11+
12+
CMD ["/main.exe"]

0 commit comments

Comments
 (0)