Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: v.oleynikov <vasily.oleynikov@flant.com>
  • Loading branch information
duckhawk committed Jun 11, 2024
1 parent d36a8bb commit 2041d3a
Showing 1 changed file with 99 additions and 0 deletions.
99 changes: 99 additions & 0 deletions images/csi-huawei/werf.inc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{{- $_ := 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 }}
fromCacheVersion: "2024-05-14.1"
git:
- add: /images/{{ $.ImageName }}
to: /
stageDependencies:
setup:
- "**/*"
includePaths:
- patches

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" }}/Huawei/eSDK_K8S_Plugin.git /esdb_k8s_plugin
- cd /esdb_k8s_plugin
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /huawei-csi ./csi
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /storage-backend-controller ./cmd/storage-backend-controller
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /storage-backend-sidecar ./cmd/storage-backend-sidecar
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /oceanctl ./cli
- chmod +x /csi
- chmod +x /storage-backend-controller
- chmod +x /storage-backend-sidecar
- chmod +x /oceanctl

---
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: /csi
to: /csi
before: setup
- image: {{ $.ImageName }}-golang-artifact
add: /storage-backend-controller
to: /storage-backend-controller
before: setup
- image: {{ $.ImageName }}-golang-artifact
add: /storage-backend-sidecar
to: /storage-backend-sidecar
before: setup
- image: {{ $.ImageName }}-golang-artifact
add: /oceanctl
to: /oceanctl
before: setup
- image: {{ $.ImageName }}-binaries-artifact
add: /relocate
to: /
before: install
includePaths:
- '**/*'
- image: {{ $.ImageName }}-binaries-artifact
add: /lib64
to: /lib64
before: install
includePaths:
- 'libresolv*'
- 'libnss_dns*'

0 comments on commit 2041d3a

Please sign in to comment.