瀏覽代碼

add dockerfile

Vladislav Yarmak 1 年之前
父節點
當前提交
916204836d
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      Dockerfile

+ 12 - 0
Dockerfile

@@ -0,0 +1,12 @@
+FROM golang AS build
+
+ARG GIT_DESC=undefined
+
+WORKDIR /go/src/github.com/Snawoot/dtlspipe
+COPY . .
+RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static" -X main.version='"$GIT_DESC" ./cmd/dtlspipe
+
+FROM scratch
+COPY --from=build /go/src/github.com/Snawoot/dtlspipe/dtlspipe /
+USER 9999:9999
+ENTRYPOINT ["/dtlspipe"]