Skip to content

Commit 24f5299

Browse files
committed
Update script to capture all images needed
1 parent 0cbd6c0 commit 24f5299

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ A limitation in the current NM REST API disallows multiple controls in a single
190190

191191
It is recommended to build all containers using the instructions in this document when practical for local deployment. To support other use cases, all images may also be built once and exported to a tar.gz using standard tools for offline deploments.
192192

193-
The script `export.sh` will create a single .tar.gz file suitable for import by Docker or Podman without requiring access to external resources.
193+
The script `export.sh` will build or pull all necessary images and create a single .tar.gz file suitable for import by Docker or Podman without requiring access to external resources.
194194

195195
The tar.gz file can be imported using `podman|docker import anms-${VERSION}-images.tar.gz`
196196

export.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
set -e
44

55
GITTAG=$(git describe --always --tags --dirty)
6-
ANMS_VERSION=${ANMS_VERSION:=${GITTAG}}
6+
export ANMS_VERSION=${ANMS_VERSION:=${GITTAG}}
7+
export DOCKER_IMAGE_TAG=${ANMS_VERSION}
78
OUTFILE="anms-${ANMS_VERSION}-images.tar.gz"
89

9-
# Get List of Images
1010
if command -v podman-compose &> /dev/null; then
1111
COMPOSE_CMD="podman-compose"
1212
elif command -v docker-compose &> /dev/null; then
@@ -18,7 +18,13 @@ else
1818
exit 1
1919
fi
2020

21-
IMAGES=$(${COMPOSE_CMD} -f docker-compose.yml -f testenv-compose.yml config | grep --color=auto 'image:' | awk '{print $2}' | sort -u | less)
21+
# Build or pull images needed
22+
COMPOSE_OPTS="-f docker-compose.yml -f testenv-compose.yml --profile full --profile dev --parallel 1"
23+
${COMPOSE_CMD} ${COMPOSE_OPTS} --podman-build-args='--format docker' build
24+
${COMPOSE_CMD} ${COMPOSE_OPTS} pull
25+
26+
# Get List of Images used
27+
IMAGES=$(${COMPOSE_CMD} ${COMPOSE_OPTS} config | grep --color=auto 'image:' | awk '{print $2}' | sort -u)
2228
echo "${COMPOSE_CMD} reports the following images: ${IMAGES}"
2329

2430
# Determine base command (docker or podman)

0 commit comments

Comments
 (0)