diff --git a/etc/docker/environment/Dockerfile b/etc/docker/environment/Dockerfile index 1d840a5c2..6180e2ebd 100644 --- a/etc/docker/environment/Dockerfile +++ b/etc/docker/environment/Dockerfile @@ -5,7 +5,16 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get -y update RUN apt-get install -y git software-properties-common sudo +RUN apt-get install -y iproute2 psmisc rsyslog +# setup openthread RUN git clone https://github.com/openthread/openthread.git +RUN cd openthread && ./script/bootstrap && cd .. -RUN cd openthread && ./script/bootstrap +# setup wpantund +RUN git clone https://github.com/openthread/wpantund.git +RUN cd wpantund && ./script/bootstrap && ./bootstrap.sh && ./configure && sudo make -j8 && sudo make install && cd .. + +COPY ./docker-entrypoint.sh / +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["bash"] diff --git a/etc/docker/environment/docker-entrypoint.sh b/etc/docker/environment/docker-entrypoint.sh new file mode 100755 index 000000000..f8b79e6da --- /dev/null +++ b/etc/docker/environment/docker-entrypoint.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Copyright (c) 2018, The OpenThread Authors. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the copyright holder nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +# +# Description: +# This file configures docker environemnt to support wpantund +# + +set -e + +mkdir -p /dev/net && mknod /dev/net/tun c 10 200 && chmod 600 /dev/net/tun +service dbus restart +service rsyslog start + +exec "$@"