1# Create Docker image that can be used for testing Zephyr network 2# sample applications. 3 4FROM gcc 5 6# Get all the extra app we need in the container 7RUN apt update && apt install -y \ 8 dante-server \ 9 curl \ 10 netcat \ 11 tcpdump 12 13# We need the net-tools project as it contains helper apps needed 14# in testing. 15RUN git clone https://github.com/zephyrproject-rtos/net-tools.git && \ 16 cd /net-tools && \ 17 make tunslip6 && make echo-client && \ 18 make echo-server && make throughput-client && \ 19 make coap-client 20 21# linuxptp daemon is needed in gPTP testing 22RUN git clone https://git.code.sf.net/p/linuxptp/code linuxptp && \ 23 cd /linuxptp && \ 24 git checkout v3.1 && \ 25 make && \ 26 make install 27 28# MQTT testing 29RUN git clone https://github.com/eclipse/mosquitto.git && \ 30 cd /mosquitto && \ 31 git checkout v1.6.9 && \ 32 make binary && \ 33 install -d /usr/local/bin/ && \ 34 install -d /usr/local/sbin/ && \ 35 install -d /usr/local/lib/ && \ 36 install -d /usr/local/etc/mosquitto/certs && \ 37 install -d /var/lib/mosquitto && \ 38 install -s -m755 /mosquitto/client/mosquitto_pub \ 39 /usr/local/bin/mosquitto_pub && \ 40 install -s -m755 /mosquitto/client/mosquitto_rr \ 41 /usr/local/bin/mosquitto_rr && \ 42 install -s -m755 /mosquitto/client/mosquitto_sub \ 43 /usr/local/bin/mosquitto_sub && \ 44 install -s -m644 /mosquitto/lib/libmosquitto.so.1 \ 45 /usr/local/lib/libmosquitto.so.1 && \ 46 install -s -m755 /mosquitto/src/mosquitto /usr/local/sbin/mosquitto && \ 47 install -s -m755 /mosquitto/src/mosquitto_passwd \ 48 /usr/local/bin/mosquitto_passwd && \ 49 rm -rf /mosquitto; \ 50 addgroup --system mosquitto && \ 51 adduser --system \ 52 --no-create-home \ 53 --disabled-password \ 54 --disabled-login \ 55 --ingroup mosquitto \ 56 mosquitto 57 58COPY mosquitto.conf mosquitto-tls.conf /usr/local/etc/mosquitto/ 59 60# Simple Python based HTTP server for http-client API testing 61# The http-get-file-test.sh is used for testing TCP with dumb-http-server-mt 62# network sample. 63# The syslog-receiver.py will test syslog-net sample 64COPY http-server.py https-server.py http-get-file-test.sh \ 65 syslog-receiver.py /usr/local/bin/ 66COPY http-get-file-test.sh /usr/local/bin/https-get-file-test.sh 67 68# Dante is SOCKS proxy. The gptp.conf is conf file for linuxptp. 69COPY danted.conf gptp.cfg /etc/ 70 71WORKDIR /net-tools 72 73# We do not run any command automatically but let the test script run 74# the proper test application script. 75