Skip to content

Commit

Permalink
Merge pull request #19 from celestiaorg/docker
Browse files Browse the repository at this point in the history
feat: add dockerFile with linux/amd64 image only
  • Loading branch information
Bidon15 authored Nov 15, 2023
2 parents ef65002 + e5a80a6 commit d45a1e1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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 @@
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"]

0 comments on commit d45a1e1

Please sign in to comment.