21461: Improves dev QoL on testing & building new WB2 docker images.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 20 Feb 2024 19:12:37 +0000 (16:12 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 20 Feb 2024 19:21:35 +0000 (16:21 -0300)
Instead of always check out the arvados repository from the git server, pass
it as a build context, so changes in dev branches can easily be iterated on.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

services/workbench2/Makefile
services/workbench2/docker/Dockerfile

index 18da156f4d09061e8bfdcd7d6c7591b3f5b40803..00efa38fc9ef3c146ee70377dc32ee01ee7c5605 100644 (file)
@@ -187,4 +187,4 @@ packages-in-docker: check-arvados-directory workbench2-build-image
                sh -c 'git config --global --add safe.directory /tmp/workbench2 && make packages'
 
 workbench2-build-image:
-       (cd docker && docker build -t workbench2-build .)
+       docker build -t workbench2-build -f docker/Dockerfile ${ARVADOS_DIRECTORY}
index e54496f35b0f321586039c9fac3f4b7d8a55004c..fa4266191aa0c3f8998cc92f879ba4195b6aef4a 100644 (file)
@@ -13,8 +13,11 @@ RUN apt-get update && \
     apt-get clean
 
 RUN /usr/bin/gem install --no-document fpm
-RUN cd /usr/src && git clone git://git.arvados.org/arvados.git && \
-    cd arvados && \
+WORKDIR /usr/src/arvados
+COPY . .
+RUN cd /usr/src/arvados && \
+    test -d cmd/arvados-server || \
+      (echo "ERROR: build context must be an Arvados repository" && false) && \
     GO_VERSION=$(grep 'goversion =' lib/install/deps.go |awk -F'"' '{print $2}') && \
     ARCH=$(dpkg --print-architecture) && \
     echo $GO_VERSION && \