11---
22# do not remove this image: used in external audits (DKP CSE)
3- image : {{ $ .ImageName }}-src-artifact
3+ image : {{ .ModuleNamePrefix }}{{ .ImageName }}-src-artifact
44fromImage : builder/src
55final : false
66git :
7- - add : /
7+ - add : {{ .ModuleDir }}
88 to : /src
99 includePaths :
1010 - api
@@ -18,32 +18,39 @@ shell:
1818 - rm -rf /src/.git
1919
2020---
21- image : {{ $ .ImageName }}-golang-artifact
21+ image : {{ .ModuleNamePrefix }}{{ .ImageName }}-golang-artifact
2222fromImage : builder/golang-alpine
2323final : false
24+
2425import :
25- - image : {{ $ .ImageName }}-src-artifact
26+ - image : {{ .ModuleNamePrefix }}{{ .ImageName }}-src-artifact
2627 add : /src
2728 to : /src
28- before : setup
29+ before : install
30+
2931mount :
30- - fromPath : ~/go-pkg-cache
31- to : /go/pkg
32+ {{ include "mount points for golang builds" . }}
33+
34+ secrets :
35+ - id : GOPROXY
36+ value : {{ .GOPROXY }}
37+
3238shell :
3339 setup :
3440 - cd /src/images/{{ $.ImageName }}/cmd
35- - export CGO_ENABLED=0 GOOS=linux GOARCH=amd64
36- - go build -ldflags="-s -w" -tags {{ $.Root .MODULE_EDITION }} -o /{{ $.ImageName }}
41+ - GOPROXY=$(cat /run/secrets/GOPROXY) go mod download
42+ - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -tags {{ .MODULE_EDITION }} -o /{{ $.ImageName }}
3743 - chmod +x /{{ $.ImageName }}
3844
3945---
40- image : {{ $ .ImageName }}
46+ image : {{ .ModuleNamePrefix }}{{ .ImageName }}
4147fromImage : base/distroless
4248import :
43- - image : {{ $ .ImageName }}-golang-artifact
49+ - image : {{ .ModuleNamePrefix }}{{ .ImageName }}-golang-artifact
4450 add : /{{ $.ImageName }}
4551 to : /{{ $.ImageName }}
4652 before : setup
47- docker :
48- ENTRYPOINT : ["/{{ $.ImageName }}"]
49- USER : deckhouse:deckhouse
53+
54+ imageSpec :
55+ config :
56+ entrypoint : ["/{{ $.ImageName }}"]
0 commit comments