1 # Copyright (c) 2018, The OpenThread Authors.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are met:
6 # 1. Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer.
8 # 2. Redistributions in binary form must reproduce the above copyright
9 # notice, this list of conditions and the following disclaimer in the
10 # documentation and/or other materials provided with the distribution.
11 # 3. Neither the name of the copyright holder nor the
12 # names of its contributors may be used to endorse or promote products
13 # derived from this software without specific prior written permission.
15 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 # POSSIBILITY OF SUCH DAMAGE.
28 ARG BASE_IMAGE=ubuntu:bionic
39 ENV BACKBONE_ROUTER=${BACKBONE_ROUTER:-0}
40 ENV OT_BACKBONE_CI=${OT_BACKBONE_CI:-0}
41 ENV OTBR_OPTIONS=${OTBR_OPTIONS}
42 ENV DEBIAN_FRONTEND noninteractive
44 ENV REFERENCE_DEVICE=${REFERENCE_DEVICE:-0}
45 ENV RELEASE=${RELEASE:-1}
55 # Required during build or run
56 ENV OTBR_DOCKER_REQS sudo
58 # Required during build, could be removed
59 ENV OTBR_DOCKER_DEPS git ca-certificates
61 # Required and installed during build (script/bootstrap), could be removed
62 ENV OTBR_BUILD_DEPS apt-utils build-essential psmisc ninja-build cmake wget ca-certificates \
63 libreadline-dev libncurses-dev libcpputest-dev libdbus-1-dev libavahi-common-dev \
64 libavahi-client-dev libboost-dev libboost-filesystem-dev libboost-system-dev libjsoncpp-dev \
65 libnetfilter-queue-dev
67 # Required for OpenThread Backbone CI
68 ENV OTBR_OT_BACKBONE_CI_DEPS curl lcov wget build-essential
70 # Required and installed during build (script/bootstrap) when RELEASE=1, could be removed
71 ENV OTBR_NORELEASE_DEPS \
77 && apt-get install --no-install-recommends -y $OTBR_DOCKER_REQS $OTBR_DOCKER_DEPS \
78 && [ "${OT_BACKBONE_CI}" != "1" ] || ( \
79 apt-get install --no-install-recommends -y $OTBR_OT_BACKBONE_CI_DEPS \
80 && MDNS_RESPONDER_SOURCE_NAME=mDNSResponder-878.30.4 \
81 && wget -4 --no-check-certificate https://opensource.apple.com/tarballs/mDNSResponder/$MDNS_RESPONDER_SOURCE_NAME.tar.gz \
82 && tar xvf $MDNS_RESPONDER_SOURCE_NAME.tar.gz \
83 && cd $MDNS_RESPONDER_SOURCE_NAME/mDNSPosix \
84 && make os=linux && sudo make install os=linux \
85 && cd - && rm -rf $MDNS_RESPONDER_SOURCE_NAME) \
86 && ln -fs /usr/share/zoneinfo/UTC /etc/localtime \
87 && ./script/bootstrap \
89 && chmod 644 /etc/bind/named.conf.options \
90 && [ "${OT_BACKBONE_CI}" = "1" ] || ( \
94 && rm -rf /usr/include \
97 && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $OTBR_DOCKER_DEPS \
98 && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $OTBR_BUILD_DEPS \
99 && ([ "${RELEASE}" = 1 ] || apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false "$OTBR_NORELEASE_DEPS";) \
100 && rm -rf /var/lib/apt/lists/* \
103 ENTRYPOINT ["/app/etc/docker/docker_entrypoint.sh"]