Skip to content

Instantly share code, notes, and snippets.

@helenst helenst/compose.diff
Created Nov 29, 2017

Embed
What would you like to do?
Docker build issues
diff --git a/compose/dev/Makefile b/compose/dev/Makefile
index 1bd9b0d..ed8ec0d 100644
--- a/compose/dev/Makefile
+++ b/compose/dev/Makefile
@@ -11,14 +11,8 @@ VERSION = $(shell git describe --tags --always --dirty)
all: destroy bootstrap
docker-compose ps
-versionfile:
- @echo "\
- version: ${VERSION}\n\
- agent_code: ${VERSION}" > ../../src/archivematica/src/version.yml
-
-build: versionfile
- # Specify compose file explicitly, we don't want to build any other container sets
- COMPOSE_FILE=$(DEFAULT_COMPOSE_FILE) docker-compose build
+build:
+ COMPOSE_PROJECT=rdss COMPOSE_FILE=$(DEFAULT_COMPOSE_FILE) docker-compose build --build-arg VERSION=v5 archivematica-dashboard
bootstrap: build bootstrap-storage-service bootstrap-dashboard restart-mcp-services
diff --git a/src/dashboard.Dockerfile b/src/dashboard.Dockerfile
index 5dddaae..305c7cd 100644
--- a/src/dashboard.Dockerfile
+++ b/src/dashboard.Dockerfile
@@ -1,5 +1,6 @@
FROM python:2.7
+ARG VERSION
ENV DEBIAN_FRONTEND noninteractive
ENV DJANGO_SETTINGS_MODULE settings.common
ENV PYTHONPATH /src/dashboard/src/:/src/archivematicaCommon/lib/
@@ -25,7 +26,9 @@ ADD dashboard/src/requirements/ /src/dashboard/src/requirements/
RUN pip install -r /src/dashboard/src/requirements/production.txt -r /src/dashboard/src/requirements/dev.txt
ADD dashboard/ /src/dashboard/
ADD dashboard/install/dashboard.gunicorn-config.py /etc/archivematica/dashboard.gunicorn-config.py
-ADD version.yml /etc/archivematica/version.yml
+RUN (echo "---"; echo "version: $VERSION") \
+ > /etc/archivematica/version.yml
+RUN cat /etc/archivematica/version.yml
RUN set -ex \
&& groupadd --gid 333 --system archivematica \
@lower29

This comment has been minimized.

Copy link

commented Nov 29, 2017

We need to also include the docker-compose.qa.yml in the DEFAULT_COMPOSE_FILE value:

-DEFAULT_COMPOSE_FILE = $(shell realpath ../docker-compose.dev.yml)
+DEFAULT_COMPOSE_FILE = $(shell realpath ../docker-compose.qa.yml):$(shell realpath ../docker-compose.dev.yml)

This ensures that the dev config is merged in with the qa config even during build. This is important because the qa config specifies the image name, whereas the dev does not. Without this, docker-compose will use the service name, archivematica-dashboard and append it to the project name, rdss.

So what we've been seeing is due to inconsistency in the inclusion (or not) of the qa config when using the dev Makefile. The build target was building rdss_archivematica-dashboard but the other targets were using the archivematica-dashboard image, hence the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.