build: move Dockerfile for httpserver to build/ dir
This commit is contained in:
parent
4814883454
commit
4c7f1c2aec
1 changed files with 6 additions and 6 deletions
30
build/package/httpserver/Dockerfile
Normal file
30
build/package/httpserver/Dockerfile
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG ALPINE_VERSION=3.19
|
||||
|
||||
FROM --platform=${BUILDPLATFORM} golang:1.22-alpine${ALPINE_VERSION} AS builder
|
||||
|
||||
ARG BUILDPLATFORM
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
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 /srv
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
COPY --from=builder /build/yggdrasil .
|
||||
|
||||
CMD ["/srv/yggdrasil"]
|
||||
Reference in a new issue