summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/data
diff options
context:
space:
mode:
authorRyan Chu <ryan.chu@qt.io>2019-04-11 16:04:06 +0200
committerRyan Chu <ryan.chu@qt.io>2019-07-01 01:09:42 +0200
commit57055ffafd9c32168e2ee94ba73655126fbaac38 (patch)
treec370ab63947ff08c47bc6132d601f8192323adb8 /mkspecs/features/data
parent889b44043ee92f77c6bb21abff556688354193d2 (diff)
Share the common configurations among different modules
This change is used to generalize a template docker-compose file for all modules. Ideally, the leaf module only need to keep a docker compose file for all platforms (docker-compose.yml). NOTE: The version of docker-compose file downgrades from 3.4 to 2.1 because the 'extends' keyword is not supported in Compose version 3.x. Change-Id: I2e36fd9236eda86cb5fcf940d787ccefe9200696 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'mkspecs/features/data')
-rw-r--r--mkspecs/features/data/testserver/Dockerfile2
-rw-r--r--mkspecs/features/data/testserver/docker-compose-common.yml38
2 files changed, 40 insertions, 0 deletions
diff --git a/mkspecs/features/data/testserver/Dockerfile b/mkspecs/features/data/testserver/Dockerfile
index 8fb664a1d2..a20d289d3f 100644
--- a/mkspecs/features/data/testserver/Dockerfile
+++ b/mkspecs/features/data/testserver/Dockerfile
@@ -21,7 +21,9 @@ RUN echo "#!/usr/bin/env bash\n" \
RUN chmod +x startup.sh
# rewrite the default configurations of avahi-daemon
+# Disable IPv6 of avahi-daemon to resolve the unstable connections on Windows
ARG test_domain
RUN sed -i -e "s,#domain-name=local,domain-name=${test_domain:-test-net.qt.local}," \
-e "s,#publish-aaaa-on-ipv4=yes,publish-aaaa-on-ipv4=no," \
+ -e "s,use-ipv6=yes,use-ipv6=no," \
/etc/avahi/avahi-daemon.conf
diff --git a/mkspecs/features/data/testserver/docker-compose-common.yml b/mkspecs/features/data/testserver/docker-compose-common.yml
new file mode 100644
index 0000000000..58282c1273
--- /dev/null
+++ b/mkspecs/features/data/testserver/docker-compose-common.yml
@@ -0,0 +1,38 @@
+version: '2.1'
+
+# This is a template docker-compose file shared with all modules. It is based
+# on 'extending services' feature of compose file version 2.1.
+# See https://docs.docker.com/compose/extends/#extending-services for details.
+#
+# Example: testserver/docker-compose.yml
+# services:
+# foo:
+# extends:
+# file: ${SHARED_DATA}/docker-compose-common.yml
+# service: ${SHARED_SERVICE}
+# container_name: qt-test-server-foo
+# hostname: ${HOST_NAME:-foo}
+# build:
+# context: .
+# args:
+# provisioningImage: qt-test-server-foo:537fe302f61851d1663...
+# serviceDir: ./foo
+# command: service/foo.sh
+
+x-services:
+ &default-service
+ domainname: ${TEST_DOMAIN}
+ build:
+ context: .
+ dockerfile: ${SHARED_DATA}/Dockerfile
+ args:
+ test_domain: ${TEST_DOMAIN}
+ entrypoint: ./startup.sh
+
+services:
+ bridge-network: *default-service
+ host-network:
+ << : *default-service
+ network_mode: "host"
+ extra_hosts:
+ - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"