diff --git a/Dockerfile-backup-driver b/Dockerfile-backup-driver index 51a88c58..256dc79a 100644 --- a/Dockerfile-backup-driver +++ b/Dockerfile-backup-driver @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM gcr.io/distroless/base-debian10:nonroot -COPY /bin/linux/amd64/lib/vmware-vix-disklib/lib64/* /vddkLibs/ +FROM gcr.io/distroless/static-debian10:nonroot ADD /bin/linux/amd64/backup-driver* /backup-driver USER nonroot:nonroot ENTRYPOINT ["/backup-driver"] diff --git a/Dockerfile-plugin b/Dockerfile-plugin index cab3af8b..86b35a1a 100644 --- a/Dockerfile-plugin +++ b/Dockerfile-plugin @@ -14,12 +14,11 @@ FROM busybox:1.33.1 AS busybox -FROM gcr.io/distroless/base-debian10:nonroot +FROM gcr.io/distroless/static-debian10:nonroot ADD /bin/linux/amd64/velero-* /plugins/ ADD /bin/linux/amd64/data-* / ADD /bin/linux/amd64/backup-driver* / COPY /bin/linux/amd64/install.sh /scripts/ -COPY /bin/linux/amd64/lib/vmware-vix-disklib/lib64/* /plugins/ ENV LD_LIBRARY_PATH=/plugins COPY --from=busybox /bin/sh /bin/sh COPY --from=busybox /bin/chmod /bin/chmod diff --git a/Makefile b/Makefile index 2893e880..32ba514a 100644 --- a/Makefile +++ b/Makefile @@ -63,14 +63,14 @@ PLUGIN_DOCKERFILE ?= Dockerfile-plugin DATAMGR_DOCKERFILE ?= Dockerfile-datamgr BACKUPDRIVER_DOCKERFILE ?= Dockerfile-backup-driver -all: dep plugin vsphere-astrolabe +all: dep datamgr backup-driver plugin vsphere-astrolabe dep: ifeq (,$(wildcard $(GOPATH)/src/$(VDDK_LIBS))) $(error "$(GOPATH)/src/$(VDDK_LIBS) cannot find vddk libs in path. Please refer to: https://github.com/vmware/virtual-disks#dependency, download the VDDK tarball to the directory $(GOPATH)/src/$(LIB_DIR)/ and untar it") endif -plugin: datamgr backup-driver +plugin: @echo "making: $@" $(MAKE) build BIN=$(PLUGIN_BIN) VERSION=$(VERSION) @@ -166,15 +166,15 @@ copy-vix-libs: copy-install-script: cp $$(pwd)/scripts/install.sh _output/bin/$(GOOS)/$(GOARCH) -build-container: copy-vix-libs container-name +build-container: container-name cp $(DOCKERFILE) _output/bin/$(GOOS)/$(GOARCH)/$(DOCKERFILE) docker build -t $(IMAGE):$(VERSION) -f _output/bin/$(GOOS)/$(GOARCH)/$(DOCKERFILE) _output -plugin-container: all copy-install-script +plugin-container: dep plugin vsphere-astrolabe copy-install-script $(MAKE) build-container IMAGE=$(PLUGIN_IMAGE) DOCKERFILE=$(PLUGIN_DOCKERFILE) VERSION=$(VERSION) datamgr-container: datamgr - $(MAKE) build-container BIN=$(DATAMGR_BIN) IMAGE=$(DATAMGR_IMAGE) DOCKERFILE=$(DATAMGR_DOCKERFILE) VERSION=$(VERSION) + $(MAKE) copy-vix-libs build-container BIN=$(DATAMGR_BIN) IMAGE=$(DATAMGR_IMAGE) DOCKERFILE=$(DATAMGR_DOCKERFILE) VERSION=$(VERSION) backup-driver-container: backup-driver $(MAKE) build-container BIN=$(BACKUPDRIVER_BIN) IMAGE=$(BACKUPDRIVER_IMAGE) DOCKERFILE=$(BACKUPDRIVER_DOCKERFILE) VERSION=$(VERSION) diff --git a/deployment/create-deployment-for-backupdriver-guest.yaml b/deployment/create-deployment-for-backupdriver-guest.yaml index fbbe5ef0..8571a21a 100644 --- a/deployment/create-deployment-for-backupdriver-guest.yaml +++ b/deployment/create-deployment-for-backupdriver-guest.yaml @@ -50,8 +50,6 @@ spec: value: velero - name: VELERO_SCRATCH_DIR value: /scratch - - name: LD_LIBRARY_PATH - value: /vddkLibs image: dpcpinternal/backup-driver: imagePullPolicy: IfNotPresent name: backup-driver diff --git a/deployment/create-deployment-for-backupdriver.yaml b/deployment/create-deployment-for-backupdriver.yaml index 982fb9f0..ce5958bb 100644 --- a/deployment/create-deployment-for-backupdriver.yaml +++ b/deployment/create-deployment-for-backupdriver.yaml @@ -50,8 +50,6 @@ spec: value: velero - name: VELERO_SCRATCH_DIR value: /scratch - - name: LD_LIBRARY_PATH - value: /vddkLibs image: dpcpinternal/backup-driver: imagePullPolicy: IfNotPresent name: backup-driver diff --git a/pkg/install/deployment.go b/pkg/install/deployment.go index b2280082..1332d9d7 100644 --- a/pkg/install/deployment.go +++ b/pkg/install/deployment.go @@ -131,10 +131,6 @@ func Deployment(namespace string, opts ...podTemplateOption) *appsv1.Deployment Name: "VELERO_SCRATCH_DIR", Value: "/scratch", }, - { - Name: "LD_LIBRARY_PATH", - Value: "/vddkLibs", - }, }, Resources: c.resources, },