Skip to content

Commit

Permalink
Docker fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gatsbyz committed Jan 24, 2024
1 parent 0cbf33e commit 1ccf867
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions Dockerfile
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"]

0 comments on commit 1ccf867

Please sign in to comment.