Skip to content

Instantly share code, notes, and snippets.

@1k-off
Created October 13, 2022 06:31
Show Gist options
  • Save 1k-off/b081a51d61b9df4fcca552370b32a4c0 to your computer and use it in GitHub Desktop.
Save 1k-off/b081a51d61b9df4fcca552370b32a4c0 to your computer and use it in GitHub Desktop.
FROM golang:1-alpine as build
WORKDIR /src
RUN apk update && apk add --no-cache ca-certificates git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
WORKDIR /src/cmd/ccc
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/ccc
WORKDIR /src/cmd/ccc-cli
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/ccc-cli
FROM scratch
LABEL maintainer="Bogdan Kosarevskyi <bogdan.kosarevskyi@gmail.com>"
WORKDIR /app
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /app /app
EXPOSE 8080
CMD ["/app/ccc"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment