2017-11-15 21:38:15 +00:00
|
|
|
FROM 32bit/ubuntu:16.04
|
|
|
|
|
2018-10-20 14:24:16 +00:00
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
2017-11-15 21:38:15 +00:00
|
|
|
# Tools
|
2018-10-20 14:26:37 +00:00
|
|
|
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
|
|
|
|
echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list && \
|
|
|
|
apt-get -qq update && \
|
|
|
|
apt-get -qq -y --no-install-recommends install \
|
2018-10-21 11:33:58 +00:00
|
|
|
ant \
|
|
|
|
build-essential \
|
|
|
|
default-jdk \
|
|
|
|
doxygen \
|
|
|
|
gdb \
|
|
|
|
git \
|
|
|
|
gksu \
|
|
|
|
gtk-sharp2 \
|
|
|
|
iputils-tracepath \
|
|
|
|
libcanberra-gtk-module:i386 \
|
|
|
|
libgtk2.0-0 \
|
|
|
|
mono-complete \
|
|
|
|
mosquitto \
|
|
|
|
mosquitto-clients \
|
|
|
|
npm \
|
|
|
|
python-pip \
|
|
|
|
python-serial \
|
|
|
|
rlwrap \
|
|
|
|
screen \
|
|
|
|
srecord \
|
|
|
|
uml-utilities \
|
|
|
|
unzip \
|
|
|
|
wget \
|
|
|
|
> /dev/null \
|
2018-10-20 14:26:37 +00:00
|
|
|
&& apt-get -qq clean
|
|
|
|
|
|
|
|
# Install coap-cli
|
|
|
|
RUN npm -q install coap-cli -g \
|
|
|
|
&& sudo ln -s /usr/bin/nodejs /usr/bin/node
|
2017-11-15 21:38:15 +00:00
|
|
|
|
|
|
|
# Install ARM toolchain
|
2018-10-20 14:25:02 +00:00
|
|
|
RUN wget -nv https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2 && \
|
2017-11-15 21:38:15 +00:00
|
|
|
tar xjf gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2 -C /tmp/ && \
|
|
|
|
cp -f -r /tmp/gcc-arm-none-eabi-5_2-2015q4/* /usr/local/ && \
|
|
|
|
rm -rf /tmp/gcc-arm-none-eabi-* gcc-arm-none-eabi-*-linux.tar.bz2
|
|
|
|
|
|
|
|
# Install msp430 toolchain
|
2018-10-20 14:25:02 +00:00
|
|
|
RUN wget -nv http://simonduq.github.io/resources/mspgcc-4.7.2-compiled.tar.bz2 && \
|
2017-11-15 21:38:15 +00:00
|
|
|
tar xjf mspgcc*.tar.bz2 -C /tmp/ && \
|
|
|
|
cp -f -r /tmp/msp430/* /usr/local/ && \
|
|
|
|
rm -rf /tmp/msp430 mspgcc*.tar.bz2
|
|
|
|
|
|
|
|
# Install NXP toolchain (partial, with binaries excluded. Download from nxp.com)
|
2018-10-20 14:25:02 +00:00
|
|
|
RUN wget -nv http://simonduq.github.io/resources/ba-elf-gcc-4.7.4-part1.tar.bz2 && \
|
|
|
|
wget -nv http://simonduq.github.io/resources/ba-elf-gcc-4.7.4-part2.tar.bz2 && \
|
|
|
|
wget -nv http://simonduq.github.io/resources/jn516x-sdk-4163-1416.tar.bz2 && \
|
2017-11-15 21:38:15 +00:00
|
|
|
mkdir /tmp/jn516x-sdk /tmp/ba-elf-gcc && \
|
|
|
|
tar xjf jn516x-sdk-*.tar.bz2 -C /tmp/jn516x-sdk && \
|
|
|
|
tar xjf ba-elf-gcc-*part1.tar.bz2 -C /tmp/ba-elf-gcc && \
|
|
|
|
tar xjf ba-elf-gcc-*part2.tar.bz2 -C /tmp/ba-elf-gcc && \
|
|
|
|
cp -f -r /tmp/jn516x-sdk /usr/ && \
|
|
|
|
cp -f -r /tmp/ba-elf-gcc /usr/ && \
|
|
|
|
rm -rf jn516x*.bz2 ba-elf-gcc*.bz2 /tmp/ba-elf-gcc* /tmp/jn516x-sdk*
|
|
|
|
|
|
|
|
ENV PATH="/usr/ba-elf-gcc/bin:${PATH}"
|
|
|
|
|
|
|
|
## Install nRF52 SDK
|
2018-10-20 14:25:02 +00:00
|
|
|
RUN wget -nv https://developer.nordicsemi.com/nRF5_IoT_SDK/nRF5_IoT_SDK_v0.9.x/nrf5_iot_sdk_3288530.zip && \
|
2017-11-15 21:38:15 +00:00
|
|
|
mkdir /usr/nrf52-sdk && \
|
2018-10-20 14:25:52 +00:00
|
|
|
unzip -q nrf5_iot_sdk_3288530.zip -d /usr/nrf52-sdk && \
|
2017-11-15 21:38:15 +00:00
|
|
|
rm nrf5_iot_sdk_3288530.zip
|
|
|
|
|
|
|
|
ENV NRF52_SDK_ROOT /usr/nrf52-sdk
|
|
|
|
|
2018-05-27 14:07:55 +00:00
|
|
|
# Install sphinx and sphinx_rtd_theme, required for building and testing the
|
|
|
|
# readthedocs API documentation
|
2018-10-20 14:25:40 +00:00
|
|
|
RUN pip -q install --upgrade pip
|
|
|
|
RUN pip -q install setuptools && pip -q install sphinx_rtd_theme sphinx
|
2018-05-27 14:07:55 +00:00
|
|
|
|
2017-11-23 09:31:56 +00:00
|
|
|
# Create user, enable X forwarding, add to group dialout
|
2017-11-15 21:38:15 +00:00
|
|
|
# -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix
|
|
|
|
RUN export uid=1000 gid=1000 && \
|
|
|
|
mkdir -p /home/user && \
|
|
|
|
echo "user:x:${uid}:${gid}:user,,,:/home/user:/bin/bash" >> /etc/passwd && \
|
|
|
|
echo "user:x:${uid}:" >> /etc/group && \
|
|
|
|
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers && \
|
|
|
|
chmod 0440 /etc/sudoers && \
|
2017-11-23 09:31:56 +00:00
|
|
|
chown ${uid}:${gid} -R /home/user && \
|
|
|
|
usermod -aG dialout user
|
2017-11-15 21:38:15 +00:00
|
|
|
|
|
|
|
# Set user for what comes next
|
|
|
|
USER user
|
|
|
|
|
|
|
|
# Environment variables
|
|
|
|
ENV JAVA_HOME /usr/lib/jvm/default-java
|
|
|
|
ENV HOME /home/user
|
|
|
|
ENV CONTIKI_NG ${HOME}/contiki-ng
|
|
|
|
ENV COOJA ${CONTIKI_NG}/tools/cooja
|
|
|
|
ENV PATH="${HOME}:${PATH}"
|
|
|
|
WORKDIR ${HOME}
|
|
|
|
|
|
|
|
# Create Cooja shortcut
|
|
|
|
RUN echo "#!/bin/bash\nant -Dbasedir=${COOJA} -f ${COOJA}/build.xml run" > ${HOME}/cooja && \
|
|
|
|
chmod +x ${HOME}/cooja
|
|
|
|
|
2018-04-30 10:14:37 +00:00
|
|
|
# Download, build and install Renode
|
2018-10-20 14:25:14 +00:00
|
|
|
RUN git clone --quiet https://github.com/renode/renode.git \
|
2018-04-30 10:14:37 +00:00
|
|
|
&& cd ${HOME}/renode \
|
|
|
|
&& git checkout v1.3 \
|
|
|
|
&& ./build.sh
|
|
|
|
ENV PATH="${HOME}/renode:${PATH}"
|
|
|
|
|
2018-05-27 14:16:27 +00:00
|
|
|
# By default, we use a Docker bind mount to share the repo with the host,
|
|
|
|
# with Docker run option:
|
2018-03-02 15:45:05 +00:00
|
|
|
# -v <HOST_CONTIKI_NG_ABS_PATH>:/home/user/contiki-ng
|
2018-05-27 14:16:27 +00:00
|
|
|
# Alternatively, uncomment the next two lines to download Contiki-NG and pre-compile Cooja.
|
|
|
|
#RUN git clone --recursive https://github.com/contiki-ng/contiki-ng.git ${CONTIKI_NG}
|
|
|
|
#RUN ant -q -f ${CONTIKI_NG}/tools/cooja/build.xml jar
|
2018-03-02 15:45:05 +00:00
|
|
|
|
2017-11-15 21:38:15 +00:00
|
|
|
# Working directory
|
|
|
|
WORKDIR ${CONTIKI_NG}
|
|
|
|
|
2018-04-30 10:15:05 +00:00
|
|
|
# Enable IPv6 -- must be done at runtime, hence added to .profile
|
|
|
|
RUN echo "sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 > /dev/null" >> ${HOME}/.profile
|
2018-03-02 15:45:05 +00:00
|
|
|
|
2017-11-15 21:38:15 +00:00
|
|
|
# Start a bash
|
2018-03-02 15:45:05 +00:00
|
|
|
CMD bash --login
|