Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add dockerFile with linux/amd64 image only #19

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
bin/
.idea/
.vscode/
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Stage 1: Build the binary
FROM --platform=linux/amd64 docker.io/golang:1.21-alpine3.18 AS builder

ENV CGO_ENABLED=0
ENV GO111MODULE=on

ADD . /app
WORKDIR /app

RUN GOOS=linux GOARCH=amd64 go build -o main .
Bidon15 marked this conversation as resolved.
Show resolved Hide resolved

# 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 .
# Command to run the executable

EXPOSE 8080
CMD ["./main"]
Bidon15 marked this conversation as resolved.
Show resolved Hide resolved