-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (17 loc) · 762 Bytes
/
Dockerfile
File metadata and controls
22 lines (17 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Stage 1: Build the Go app
FROM --platform=$BUILDPLATFORM 020413372491.dkr.ecr.us-east-1.amazonaws.com/pullthrough/docker.io/library/golang:1.26.1-alpine AS builder
ARG TARGETOS TARGETARCH
RUN apk add --no-cache git bash sed findutils
WORKDIR /app
# Copy source and vendor typescript-go
COPY . .
RUN bash vendor-tsgo.sh
RUN go mod tidy
# Build the Go application
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o goodchanges .
# Stage 2: Run the app
FROM 020413372491.dkr.ecr.us-east-1.amazonaws.com/pullthrough/docker.io/library/alpine:3.23
RUN apk add --no-cache git && git config --global --add safe.directory '*'
# Copy the built Go app binary
COPY --from=builder /app/goodchanges /usr/bin/goodchanges
ENTRYPOINT ["/usr/bin/goodchanges"]