mirror of
https://github.com/jpillora/chisel
synced 2024-10-18 16:02:19 +00:00
switch to scratch image
This commit is contained in:
parent
feb571f714
commit
5ad1141361
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -58,9 +58,9 @@ jobs:
|
|||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
username: jpillora
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Docker meta
|
||||
id: docker_meta
|
||||
|
|
16
Dockerfile
16
Dockerfile
|
@ -1,16 +1,16 @@
|
|||
# build stage
|
||||
FROM golang:1.19 as build
|
||||
LABEL maintainer="dev@jpillora.com"
|
||||
ENV CGO_ENABLED 0
|
||||
FROM golang:alpine AS build
|
||||
RUN apk update && apk add git
|
||||
ADD . /src
|
||||
WORKDIR /src
|
||||
RUN go mod download
|
||||
ENV CGO_ENABLED 0
|
||||
RUN go build \
|
||||
-ldflags "-X github.com/jpillora/chisel/share.BuildVersion=$(git describe --abbrev=0 --tags)" \
|
||||
-o chisel
|
||||
-o /tmp/bin
|
||||
# run stage
|
||||
FROM scratch
|
||||
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
LABEL maintainer="dev@jpillora.com"
|
||||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
WORKDIR /app
|
||||
COPY --from=build /src/chisel /app/chisel
|
||||
ENTRYPOINT ["/app/chisel"]
|
||||
COPY --from=build /tmp/bin /app/bin
|
||||
ENTRYPOINT ["/app/bin"]
|
Loading…
Reference in a new issue