Skip to content

Commit 2b7fdce

Browse files
authored
Fixes for built-image tag and base-image qualified name (#276)
* Fixes for built-image tag and base-image qualified name * Update script to capture all images needed
1 parent a0dbdb9 commit 2b7fdce

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
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

anms.Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ COPY deps/dtnma-adms /usr/src/dtnma-adms
7272

7373

7474
# This is a postgres stateful database with data definition startup SQL scripts
75-
FROM postgres:14 AS anms-sql
75+
FROM docker.io/library/postgres:14 AS anms-sql
7676

7777
COPY deps/anms_db_tables/*.sql /docker-entrypoint-initdb.d/
7878
COPY deps/dtnma-tools/refdb-sql/postgres/Database_Scripts/*.sql /docker-entrypoint-initdb.d/

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ services:
135135

136136
mqtt-broker:
137137
hostname: mqtt-broker
138-
image: ${DOCKER_IMAGE_PREFIX}mqtt-broker
138+
image: ${DOCKER_IMAGE_PREFIX}mqtt-broker:${DOCKER_IMAGE_TAG}
139139
build:
140140
dockerfile: anms.Containerfile
141141
target: mqtt-broker

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)