-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #297 from k-wall/dockerfile
Simple Dockerfile for kaf.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM golang:1.22 as BuildStage | ||
|
||
# Set destination for COPY | ||
WORKDIR /app | ||
|
||
# Download Go modules | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
COPY . ./ | ||
|
||
# Build | ||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-w -s" -o /kaf ./cmd/kaf | ||
|
||
FROM scratch | ||
|
||
WORKDIR / | ||
|
||
COPY --from=BuildStage /kaf /bin/kaf | ||
|
||
USER 1001 | ||
|
||
# Run | ||
CMD ["/bin/kaf"] |
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