-
Notifications
You must be signed in to change notification settings - Fork 1
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 #10 from c16a/feature/c16a
Fix Dockerfile and add container attestations
- Loading branch information
Showing
3 changed files
with
15 additions
and
23 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
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
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,26 +1,16 @@ | ||
# Stage 1: Build the Go application (compiler and dependencies) | ||
FROM golang:1.22.2 AS builder | ||
FROM docker.io/library/golang:1.22.2 AS builder | ||
|
||
WORKDIR /app | ||
|
||
# Copy your Go source code | ||
COPY go.mod ./ | ||
COPY go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
ENV CGO_ENABLED=0 | ||
RUN go build -ldflags="-s -w" -o microq github.com/c16a/microq | ||
|
||
# Stage 2: Production image (slim and optimized) | ||
FROM scratch | ||
|
||
WORKDIR /app | ||
|
||
# Copy only the built binary from the builder stage | ||
COPY --from=builder /app/microq ./ | ||
|
||
# Expose the port your application listens on (replace 8080 with your actual port) | ||
EXPOSE 8080 | ||
|
||
# Set the command to execute your binary | ||
CMD ["microq"] | ||
CMD ["/app/microq"] |