containerized-build: set WORKDIR and use in make target

By setting the WORKDIR in the container image, there is no need to pass
it on the commandline in the Makefile. This makes the line for the make
target a little cleaner.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-04-20 17:30:11 +02:00 committed by mergify[bot]
parent ceef252a24
commit 2c6c0decbe
2 changed files with 3 additions and 1 deletions

View File

@ -79,7 +79,7 @@ cephcsi:
.PHONY: containerized-build containerized-test
containerized-build: .devel-container-id
$(CONTAINER_CMD) run --rm -v $(PWD):/go/src/github.com/ceph/ceph-csi$(SELINUX_VOL_FLAG) $(CSI_IMAGE_NAME):devel make -C /go/src/github.com/ceph/ceph-csi cephcsi
$(CONTAINER_CMD) run --rm -v $(PWD):/go/src/github.com/ceph/ceph-csi$(SELINUX_VOL_FLAG) $(CSI_IMAGE_NAME):devel make cephcsi
containerized-test: .test-container-id
$(CONTAINER_CMD) run --rm -v $(PWD):/go/src/github.com/ceph/ceph-csi$(SELINUX_VOL_FLAG) $(CSI_IMAGE_NAME):test make test

View File

@ -18,3 +18,5 @@ RUN dnf -y install \
librbd-devel \
&& dnf -y update \
&& true
WORKDIR "/go/src/github.com/ceph/ceph-csi"