• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#  Copyright (c) 2018, The OpenThread Authors.
2#  All rights reserved.
3#
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.
14#
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.
26#
27
28ARG BASE_IMAGE=ubuntu:bionic
29FROM ${BASE_IMAGE}
30
31ARG INFRA_IF_NAME
32ARG BORDER_ROUTING
33ARG BACKBONE_ROUTER
34ARG OT_BACKBONE_CI
35ARG OTBR_OPTIONS
36ARG DNS64
37ARG NAT64
38ARG NAT64_SERVICE
39ARG NAT64_DYNAMIC_POOL
40ARG REFERENCE_DEVICE
41ARG RELEASE
42ARG REST_API
43ARG WEB_GUI
44ARG MDNS
45ARG FIREWALL
46ARG DNSSD_PLAT
47
48ENV INFRA_IF_NAME=${INFRA_IF_NAME:-eth0}
49ENV BORDER_ROUTING=${BORDER_ROUTING:-1}
50ENV BACKBONE_ROUTER=${BACKBONE_ROUTER:-1}
51ENV OT_BACKBONE_CI=${OT_BACKBONE_CI:-0}
52ENV OTBR_MDNS=${MDNS:-mDNSResponder}
53ENV OTBR_OPTIONS=${OTBR_OPTIONS}
54ENV DEBIAN_FRONTEND noninteractive
55ENV PLATFORM ubuntu
56ENV REFERENCE_DEVICE=${REFERENCE_DEVICE:-0}
57ENV RELEASE=${RELEASE:-1}
58ENV NAT64=${NAT64:-1}
59ENV NAT64_SERVICE=${NAT64_SERVICE:-openthread}
60ENV NAT64_DYNAMIC_POOL=${NAT64_DYNAMIC_POOL:-192.168.255.0/24}
61ENV DNS64=${DNS64:-0}
62ENV WEB_GUI=${WEB_GUI:-1}
63ENV REST_API=${REST_API:-1}
64ENV FIREWALL=${FIREWALL:-1}
65ENV DNSSD_PLAT=${DNSSD_PLAT:-0}
66ENV DOCKER 1
67
68RUN env
69
70# Required during build or run
71ENV OTBR_DOCKER_REQS sudo python3
72
73# Required during build, could be removed
74ENV OTBR_DOCKER_DEPS git ca-certificates
75
76# Required and installed during build (script/bootstrap), could be removed
77ENV OTBR_BUILD_DEPS apt-utils build-essential psmisc ninja-build cmake wget ca-certificates \
78  libreadline-dev libncurses-dev libdbus-1-dev libavahi-common-dev \
79  libavahi-client-dev \
80  libnetfilter-queue-dev
81
82# Required for OpenThread Backbone CI
83ENV OTBR_OT_BACKBONE_CI_DEPS curl lcov wget build-essential python3-dbus python3-zeroconf socat
84
85# Resolves issue with installing libc-bin
86RUN rm /var/lib/dpkg/info/libc-bin.* \
87  && apt-get clean -y \
88  && apt-get update -y \
89  && apt-get install --no-install-recommends -y libc-bin
90
91RUN apt-get update \
92  && apt-get install --no-install-recommends -y $OTBR_DOCKER_REQS $OTBR_DOCKER_DEPS \
93  && ([ "${OT_BACKBONE_CI}" != "1" ] || apt-get install --no-install-recommends -y $OTBR_OT_BACKBONE_CI_DEPS) \
94  && ln -fs /usr/share/zoneinfo/UTC /etc/localtime
95
96COPY ./script /app/script
97COPY ./third_party/mDNSResponder /app/third_party/mDNSResponder
98WORKDIR /app
99
100RUN ./script/bootstrap
101COPY . .
102RUN ./script/setup
103
104RUN ([ "${DNS64}" = "0" ] || chmod 644 /etc/bind/named.conf.options) \
105  && ([ "${OT_BACKBONE_CI}" = "1" ] || ( \
106    mv ./script /tmp \
107    && mv ./etc /tmp \
108    && find . -delete \
109    && rm -rf /usr/include \
110    && mv /tmp/script . \
111    && mv /tmp/etc . \
112    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $OTBR_DOCKER_DEPS \
113    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $OTBR_BUILD_DEPS  \
114    && rm -rf /var/lib/apt/lists/* \
115    && rm -rf /tmp/* \
116  ))
117
118ENTRYPOINT ["/app/etc/docker/docker_entrypoint.sh"]
119
120EXPOSE 80
121