1
0
Fork 0
This repository has been archived on 2025-09-02. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-yggdrasil/Dockerfile

30 lines
500 B
Docker

# syntax=docker/dockerfile:1
ARG ALPINE_VERSION=3.19
FROM --platform=${BUILDPLATFORM} golang:1.22-alpine${ALPINE_VERSION} AS builder
ARG BUILDPLATFORM
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG TARGETOS
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o yggdrasil ./cmd/yggdrasil
FROM alpine:${ALPINE_VERSION} AS runtime
WORKDIR /app
RUN apk add --no-cache ca-certificates
COPY --from=builder /app/yggdrasil .
CMD ["/app/yggdrasil"]