-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: v.oleynikov <[email protected]>
- Loading branch information
Showing
5 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{{- $_ := set . "BASE_GOLANG_22_ALPINE" "registry.deckhouse.io/base_images/golang:1.22.1-alpine@sha256:0de6cf7cceab6ecbf0718bdfb675b08b78113c3709c5e4b99456cdb2ae8c2495" }} | ||
{{- $_ := set . "BASE_SCRATCH" "registry.deckhouse.io/base_images/scratch@sha256:b054705fcc9f2205777d80a558d920c0b4209efdc3163c22b5bfcb5dda1db5fc" }} | ||
{{- $_ := set . "BASE_ALPINE_DEV" "registry.deckhouse.io/base_images/dev-alpine:3.16.3@sha256:c706fa83cc129079e430480369a3f062b8178cac9ec89266ebab753a574aca8e" }} | ||
{{- $_ := set . "BASE_ALT_DEV" "registry.deckhouse.io/base_images/dev-alt:p10@sha256:76e6e163fa982f03468166203488b569e6d9fc10855d6a259c662706436cdcad" }} | ||
|
||
--- | ||
image: {{ $.ImageName }}-golang-artifact | ||
from: {{ $.BASE_GOLANG_22_ALPINE }} | ||
|
||
mount: | ||
- fromPath: ~/go-pkg-cache | ||
to: /go/pkg | ||
shell: | ||
beforeInstall: | ||
- apk add --no-cache ca-certificates make git | ||
install: | ||
- export GO_VERSION={{ env "GOLANG_VERSION" }} | ||
- export GOPROXY={{ env "GOPROXY" }} | ||
- git clone --depth 1 --branch {{ env "SOURCE_REPO_TAG" }} {{ env "SOURCE_REPO" }}/kubernetes-csi/csi-driver-nfs.git /csi-driver-nfs | ||
- cd /csi-driver-nfs/cmd/nfsplugin | ||
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /nfsplugin | ||
- chmod +x /nfsplugin | ||
|
||
--- | ||
{{ $csiBinaries := "/bin/mount /bin/umount /sbin/mount.nfs /sbin/mount.nfs4" }} | ||
--- | ||
image: {{ $.ImageName }}-binaries-artifact | ||
from: {{ $.BASE_ALT_DEV }} | ||
|
||
shell: | ||
install: | ||
- /binary_replace.sh -i "{{ $csiBinaries }}" -o /relocate | ||
|
||
--- | ||
image: {{ $.ImageName }}-distroless-artifact | ||
from: {{ $.BASE_ALPINE_DEV }} | ||
|
||
shell: | ||
install: | ||
- mkdir -p /relocate/bin /relocate/sbin /relocate/etc /relocate/etc/ssl /relocate/usr/bin /relocate/usr/sbin /relocate/usr/share | ||
- cp -pr /tmp /relocate | ||
- cp -pr /etc/passwd /etc/group /etc/hostname /etc/hosts /etc/shadow /etc/protocols /etc/services /etc/nsswitch.conf /relocate/etc | ||
- cp -pr /usr/share/ca-certificates /relocate/usr/share | ||
- cp -pr /usr/share/zoneinfo /relocate/usr/share | ||
- cp -pr etc/ssl/cert.pem /relocate/etc/ssl | ||
- cp -pr /etc/ssl/certs /relocate/etc/ssl | ||
- echo "deckhouse:x:64535:64535:deckhouse:/:/sbin/nologin" >> /relocate/etc/passwd | ||
- echo "deckhouse:x:64535:" >> /relocate/etc/group | ||
- echo "deckhouse:!::0:::::" >> /relocate/etc/shadow | ||
|
||
--- | ||
image: {{ $.ImageName }}-distroless | ||
from: {{ $.BASE_SCRATCH }} | ||
|
||
import: | ||
- image: {{ $.ImageName }}-distroless-artifact | ||
add: /relocate | ||
to: / | ||
before: setup | ||
|
||
--- | ||
image: {{ $.ImageName }} | ||
fromImage: {{ $.ImageName }}-distroless | ||
|
||
import: | ||
- image: {{ $.ImageName }}-golang-artifact | ||
add: /nfsplugin | ||
to: /nfsplugin | ||
before: setup | ||
- image: {{ $.ImageName }}-binaries-artifact | ||
add: /relocate | ||
to: / | ||
before: install | ||
includePaths: | ||
- '**/*' | ||
|
||
docker: | ||
ENTRYPOINT: ["/nfsplugin"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
giterminismConfigVersion: 1 | ||
config: | ||
goTemplateRendering: # The rules for the Go-template functions to be able to pass build context to the release | ||
allowEnvVariables: [ /CI_.+/, MODULES_MODULE_TAG ] | ||
allowEnvVariables: [ /CI_.+/, MODULES_MODULE_TAG, GOLANG_VERSION, GOPROXY, SOURCE_REPO_TAG, SOURCE_REPO ] | ||
stapel: | ||
mount: | ||
allowBuildDir: true | ||
allowFromPaths: | ||
- ~/go-pkg-cache |