-
Notifications
You must be signed in to change notification settings - Fork 2
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 #19 from celestiaorg/docker
feat: add dockerFile with linux/amd64 image only
- Loading branch information
Showing
2 changed files
with
22 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
bin/ | ||
.idea/ | ||
.vscode/ |
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,20 @@ | ||
FROM --platform=linux/amd64 docker.io/golang:1.21-alpine3.18 AS builder | ||
|
||
ENV CGO_ENABLED=0 | ||
ENV GO111MODULE=on | ||
|
||
ADD . /app | ||
WORKDIR /app | ||
|
||
# Stage 1: Build the binary | ||
RUN GOOS=linux GOARCH=amd64 go build -o main . | ||
|
||
# Stage 2: Create the runtime image | ||
FROM docker.io/alpine:3.18.4 | ||
|
||
RUN apk update && apk add --no-cache bash curl jq | ||
COPY --from=builder /app/main . | ||
|
||
EXPOSE 8080 | ||
# Command to run the executable | ||
CMD ["./main"] |