diff --git a/dhcp/Dockerfile b/dhcp/Dockerfile new file mode 100644 index 00000000..a30f72f0 --- /dev/null +++ b/dhcp/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.26 AS builder +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -o /bootz-dhcp ./dhcp/main + +FROM gcr.io/distroless/static-debian12 +COPY --from=builder /bootz-dhcp /bootz-dhcp +# DHCP needs to run as root to bind to port 67 and use raw sockets. +# hadolint ignore=DL3002 +USER nonroot +ENTRYPOINT ["/bootz-dhcp"] + diff --git a/http/Dockerfile b/http/Dockerfile new file mode 100644 index 00000000..3b27fc0a --- /dev/null +++ b/http/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.26 AS builder +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -o /bootz-http ./http/main + +FROM gcr.io/distroless/static-debian12 +WORKDIR /www +COPY --from=builder /bootz-http /bootz-http +# HTTP server might need to run as root to bind to port 80. +# hadolint ignore=DL3002 +USER nonroot +ENTRYPOINT ["/bootz-http"] +CMD ["-address", ":8080"] + +