Dockerfile 430 B

12345678910111213
  1. FROM --platform=$BUILDPLATFORM golang AS build
  2. ARG GIT_DESC=undefined
  3. WORKDIR /go/src/github.com/SenseUnit/dtlspipe
  4. COPY . .
  5. ARG TARGETOS TARGETARCH
  6. RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static" -X main.version='"$GIT_DESC" ./cmd/dtlspipe
  7. FROM scratch
  8. COPY --from=build /go/src/github.com/SenseUnit/dtlspipe/dtlspipe /
  9. USER 9999:9999
  10. ENTRYPOINT ["/dtlspipe"]