]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
automation: introduce CONTAINER_NO_PULL for containerize
authorWei Liu <wei.liu2@citrix.com>
Mon, 19 Nov 2018 12:11:48 +0000 (12:11 +0000)
committerWei Liu <wei.liu2@citrix.com>
Tue, 20 Nov 2018 16:54:55 +0000 (16:54 +0000)
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
automation/build/README.md
automation/scripts/containerize

index f6cfd46f1ec6fb7801ccb6cb49951d4c0f9ec46e..d8c8a18e339f159ea53cb930217edc33584c8be9 100644 (file)
@@ -52,6 +52,9 @@ understands.
 
 - CONTAINER_UID0: This specifies whether root is used inside the container.
 
+- CONTAINER_NO_PULL: If set to 1, the script will not pull from docker hub.
+  This is useful when testing container locally.
+
 - XEN_CONFIG_EXPERT: If this is defined in your shell it will be
   automatically passed through to the container.
 
index aa08274eba4d496e8515aa13f9ac2a8da71483c5..a3e5d79c70a268e7b01311429450eef7d0a9d9ea 100755 (executable)
@@ -42,9 +42,11 @@ tty -s && termint=t
 # Fetch the latest version of the container in hub.docker.com,
 # unless it's a newly created local copy.
 #
-einfo "*** Ensuring ${CONTAINER} is up to date"
-docker pull ${CONTAINER} > /dev/null ||     \
-    die "Failed to update docker container"
+if [[ "_${CONTAINER_NO_PULL}" != "_1" ]]; then
+    einfo "*** Ensuring ${CONTAINER} is up to date"
+    docker pull ${CONTAINER} > /dev/null ||     \
+        die "Failed to update docker container"
+fi
 
 if hash greadlink > /dev/null 2>&1; then
     READLINK=greadlink