Skip to content

Commit

Permalink
chore: optimize docker image with scratch image
Browse files Browse the repository at this point in the history
  • Loading branch information
hacktivist123 committed May 30, 2024
1 parent 7a93149 commit 3130ae7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ RUN apk add --no-cache git

# Clone the repository and build the goignore executable
RUN git clone https://github.com/hacktivist123/goignore . && \
go build -o /go/bin/goignore ./cmd/goignore
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/bin/goignore ./cmd/goignore

# goignore Container Image
FROM alpine:latest
FROM scratch

# Maintainer info
LABEL org.opencontainers.image.authors="Shedrack Akintayo" \
Expand All @@ -24,4 +24,4 @@ WORKDIR /goignore
COPY --from=builder /go/bin/goignore /usr/local/bin/goignore

# Set the entrypoint
ENTRYPOINT [ "goignore" ]
ENTRYPOINT [ "/usr/local/bin/goignore" ]

0 comments on commit 3130ae7

Please sign in to comment.