-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
# Use an official Go runtime as a parent image | ||
FROM golang:1.21 as builder | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /go/src/app | ||
|
||
# Copy the Go source code and .git directory into the container | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
COPY . . | ||
|
||
# Build your Go app using the 'build' target in your Makefile | ||
RUN CGO_ENABLED=0 make build | ||
|
||
# Use a smaller base image to create a minimal final image | ||
FROM scratch | ||
|
||
# Set working directory | ||
WORKDIR /root/ | ||
|
||
# Copy the binary from the builder stage | ||
COPY --from=builder /go/src/app/out/polycli . | ||
|
||
# Command to run the binary | ||
CMD ["./polycli"]\ | ||
WORKDIR / | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=builder /go/src/app/out/polycli /usr/bin/polycli | ||
ENTRYPOINT ["polycli"] | ||
CMD ["--help"] |