In order to build the container from different
working directory we need to properly specify the path
to py-requirements.txt. Add ARG into the Dockerfile
and into Makefile which allows us to specify the path.

Signed-off-by: Ales Musil <[email protected]>
---
 utilities/containers/Makefile          | 5 ++++-
 utilities/containers/fedora/Dockerfile | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/utilities/containers/Makefile b/utilities/containers/Makefile
index 8b39e3493..ef1d42aca 100644
--- a/utilities/containers/Makefile
+++ b/utilities/containers/Makefile
@@ -1,7 +1,10 @@
 CONTAINER_CMD ?= podman
 DISTRO ?= fedora
 IMAGE_NAME ?= "ovn-org/ovn-tests"
+CONTAINERS_PATH ?= "."
 
 .PHONY: build
 
-build: ;$(CONTAINER_CMD) build --no-cache --rm -t $(IMAGE_NAME) -f 
$(DISTRO)/Dockerfile .
+build:
+       $(CONTAINER_CMD) build --no-cache --rm -t $(IMAGE_NAME) \
+       -f $(DISTRO)/Dockerfile . --build-arg=CONTAINERS_PATH=$(CONTAINERS_PATH)
diff --git a/utilities/containers/fedora/Dockerfile 
b/utilities/containers/fedora/Dockerfile
index 4212e2d76..4058d7f5b 100755
--- a/utilities/containers/fedora/Dockerfile
+++ b/utilities/containers/fedora/Dockerfile
@@ -1,5 +1,7 @@
 FROM quay.io/fedora/fedora:latest
 
+ARG CONTAINERS_PATH
+
 # Update distro, install packages and clean any possible leftovers
 RUN dnf -y update \
     && \
@@ -52,7 +54,7 @@ RUN git clone 
git://git.kernel.org/pub/scm/devel/sparse/sparse.git \
 
 WORKDIR /workspace
 
-COPY py-requirements.txt /tmp/py-requirements.txt
+COPY $CONTAINERS_PATH/py-requirements.txt /tmp/py-requirements.txt
 
 # Update and install pip dependencies
 RUN python3 -m pip install --upgrade pip \
-- 
2.39.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to