diff options
author | Ryan Chu <ryan.chu@qt.io> | 2018-07-02 14:57:17 +0200 |
---|---|---|
committer | Ryan Chu <ryan.chu@qt.io> | 2018-07-10 14:55:18 +0000 |
commit | e99fe6b35439577318916ba2d8b28a2d6be2cdfc (patch) | |
tree | 26a6560c3ec2f4e99921242dbe6c73bdacf96b31 | |
parent | 4869ad6a49de690a532e637a3939eb56068a8646 (diff) |
Docker Provisioning: Install Avahi and enable mDNS service discovery
The challenge of connecting Docker containers from the host is to
resolve a predefined hostname to an IP address assigned at runtime. For
Unix-like platforms such as Ubuntu, it can be done by either hard-code
the IP addresses or creating a DNS server. Both of them are not
user-friendly which need root permission to modify system files.
Avahi is a free Zeroconf implementation and provides multicast DNS
(mDNS) service discovery. It enables Docker containers to publish their
services on a local network. For the host systems supporting mDNS
technology, they will automatically discover the services in a local
domain without extra user-efforts.
Task-number: QTQAINFRA-1686
Change-Id: I1ef464a455cef5d331a3e2eb0194e2741172ef95
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
6 files changed, 5 insertions, 15 deletions
diff --git a/coin/provisioning/common/linux/testserver/apache2/Dockerfile b/coin/provisioning/common/linux/testserver/apache2/Dockerfile index b502a008..bb2dc850 100644 --- a/coin/provisioning/common/linux/testserver/apache2/Dockerfile +++ b/coin/provisioning/common/linux/testserver/apache2/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:16.04 -RUN apt-get update && apt-get install -y apache2 libcgi-session-perl wget +RUN apt-get update && apt-get install -y apache2 libcgi-session-perl wget avahi-daemon EXPOSE 80 443 # install configurations and test data diff --git a/coin/provisioning/common/linux/testserver/danted/Dockerfile b/coin/provisioning/common/linux/testserver/danted/Dockerfile index d706b7e7..eb2ac6ff 100644 --- a/coin/provisioning/common/linux/testserver/danted/Dockerfile +++ b/coin/provisioning/common/linux/testserver/danted/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:16.04 -RUN apt-get update && apt-get install -y gdebi-core=0.9.5.7ubuntu1 wget +RUN apt-get update && apt-get install -y gdebi-core=0.9.5.7ubuntu1 wget avahi-daemon RUN wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb RUN gdebi -n dante-server_1.4.1-1_amd64.deb EXPOSE 1080-1081 diff --git a/coin/provisioning/common/linux/testserver/ftp-proxy/Dockerfile b/coin/provisioning/common/linux/testserver/ftp-proxy/Dockerfile index 2bf9220b..cecb2dca 100644 --- a/coin/provisioning/common/linux/testserver/ftp-proxy/Dockerfile +++ b/coin/provisioning/common/linux/testserver/ftp-proxy/Dockerfile @@ -1,3 +1,3 @@ FROM ubuntu:16.04 -RUN apt-get update && apt-get install -y ftp-proxy=1.9.2.4-10 +RUN apt-get update && apt-get install -y ftp-proxy=1.9.2.4-10 avahi-daemon EXPOSE 2121 diff --git a/coin/provisioning/common/linux/testserver/squid/Dockerfile b/coin/provisioning/common/linux/testserver/squid/Dockerfile index c4256f48..0b930bca 100644 --- a/coin/provisioning/common/linux/testserver/squid/Dockerfile +++ b/coin/provisioning/common/linux/testserver/squid/Dockerfile @@ -1,3 +1,3 @@ FROM ubuntu:16.04 -RUN apt-get update && apt-get install -y squid=3.5.12-1ubuntu7.5 +RUN apt-get update && apt-get install -y squid=3.5.12-1ubuntu7.5 avahi-daemon EXPOSE 3128-3130 diff --git a/coin/provisioning/common/linux/testserver/vsftpd/Dockerfile b/coin/provisioning/common/linux/testserver/vsftpd/Dockerfile index 58ca6cff..f8e32d40 100644 --- a/coin/provisioning/common/linux/testserver/vsftpd/Dockerfile +++ b/coin/provisioning/common/linux/testserver/vsftpd/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:16.04 -RUN apt-get update && apt-get install -y vsftpd=3.0.3-3ubuntu2 ftp=0.17-33 wget +RUN apt-get update && apt-get install -y vsftpd=3.0.3-3ubuntu2 ftp=0.17-33 wget avahi-daemon EXPOSE 20-21 # install configurations and test data diff --git a/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/80-docker.sh b/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/80-docker.sh index 18c106ae..90c3a7eb 100755 --- a/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/80-docker.sh +++ b/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/80-docker.sh @@ -48,15 +48,5 @@ sudo docker info sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose -# Append address and hostname of test servers to CI environment. -cat <<EOF | sudo tee -a /etc/hosts -# Docker-based network test servers -172.18.0.2 apache2.test-net.qt -172.18.0.3 squid.test-net.qt -172.18.0.4 vsftpd.test-net.qt -172.18.0.5 ftp-proxy.test-net.qt -172.18.0.6 danted.test-net.qt -EOF - # Start testserver provisioning source "${BASH_SOURCE%/*}/../common/linux/testserver/docker_testserver.sh" |