Docker: enable IPv6 automatically in container
This commit is contained in:
parent
012d426642
commit
b909fb2878
@ -14,7 +14,7 @@ before_install:
|
|||||||
- ant -q -f $CNG_HOST_PATH/tools/cooja/build.xml jar
|
- ant -q -f $CNG_HOST_PATH/tools/cooja/build.xml jar
|
||||||
|
|
||||||
script: # The test script for each build.
|
script: # The test script for each build.
|
||||||
- docker run --privileged -v $CNG_HOST_PATH:/home/user/contiki-ng -ti $DOCKER_IMG bash -c "make -C tests/??-$TEST_NAME";
|
- docker run --privileged -v $CNG_HOST_PATH:/home/user/contiki-ng -ti $DOCKER_IMG bash --login -c "make -C tests/??-$TEST_NAME";
|
||||||
# Check outcome of the test
|
# Check outcome of the test
|
||||||
- $CNG_HOST_PATH/tests/check-test.sh $CNG_HOST_PATH/tests/??-$TEST_NAME; exit $?;
|
- $CNG_HOST_PATH/tests/check-test.sh $CNG_HOST_PATH/tests/??-$TEST_NAME; exit $?;
|
||||||
|
|
||||||
|
@ -17,9 +17,6 @@ java -Xshare:on -jar $CONTIKI/tools/cooja/dist/cooja.jar -nogui=$BASENAME.csc -c
|
|||||||
JPID=$!
|
JPID=$!
|
||||||
sleep 20
|
sleep 20
|
||||||
|
|
||||||
echo "Enabling IPv6"
|
|
||||||
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
|
|
||||||
|
|
||||||
# Connect to the simlation
|
# Connect to the simlation
|
||||||
echo "Starting tunslip6"
|
echo "Starting tunslip6"
|
||||||
make -C $CONTIKI/tools tunslip6
|
make -C $CONTIKI/tools tunslip6
|
||||||
|
@ -7,9 +7,6 @@ BASENAME=01-native-ping
|
|||||||
|
|
||||||
IPADDR=fd00::302:304:506:708
|
IPADDR=fd00::302:304:506:708
|
||||||
|
|
||||||
echo "Enabling IPv6"
|
|
||||||
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
|
|
||||||
|
|
||||||
# Starting Contiki-NG native node
|
# Starting Contiki-NG native node
|
||||||
echo "Starting native node"
|
echo "Starting native node"
|
||||||
make -C $CONTIKI/examples/hello-world > make.log 2> make.err
|
make -C $CONTIKI/examples/hello-world > make.log 2> make.err
|
||||||
|
@ -10,9 +10,6 @@ IPADDR=fd00::302:304:506:708
|
|||||||
declare -i OKCOUNT=0
|
declare -i OKCOUNT=0
|
||||||
declare -i TESTCOUNT=0
|
declare -i TESTCOUNT=0
|
||||||
|
|
||||||
echo "Enabling IPv6"
|
|
||||||
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
|
|
||||||
|
|
||||||
# Starting Contiki-NG native node
|
# Starting Contiki-NG native node
|
||||||
echo "Starting native CoAP server"
|
echo "Starting native CoAP server"
|
||||||
make -C $CONTIKI/examples/coap > make.log 2> make.err
|
make -C $CONTIKI/examples/coap > make.log 2> make.err
|
||||||
|
@ -18,9 +18,6 @@ java -Xshare:on -jar $CONTIKI/tools/cooja/dist/cooja.jar -nogui=$BASENAME.csc -c
|
|||||||
JPID=$!
|
JPID=$!
|
||||||
sleep 20
|
sleep 20
|
||||||
|
|
||||||
echo "Enabling IPv6"
|
|
||||||
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
|
|
||||||
|
|
||||||
# Connect to the simlation
|
# Connect to the simlation
|
||||||
echo "Starting tunslip6"
|
echo "Starting tunslip6"
|
||||||
make -C $CONTIKI/tools tunslip6
|
make -C $CONTIKI/tools tunslip6
|
||||||
|
@ -18,9 +18,6 @@ java -Xshare:on -jar $CONTIKI/tools/cooja/dist/cooja.jar -nogui=$BASENAME.csc -c
|
|||||||
JPID=$!
|
JPID=$!
|
||||||
sleep 20
|
sleep 20
|
||||||
|
|
||||||
echo "Enabling IPv6"
|
|
||||||
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
|
|
||||||
|
|
||||||
# Connect to the simlation
|
# Connect to the simlation
|
||||||
echo "Starting native border-router"
|
echo "Starting native border-router"
|
||||||
nohup make -C $CONTIKI/examples/rpl-border-router/ connect-router-cooja TARGET=native >> $BASENAME.nbr.log 2>&1 &
|
nohup make -C $CONTIKI/examples/rpl-border-router/ connect-router-cooja TARGET=native >> $BASENAME.nbr.log 2>&1 &
|
||||||
|
@ -7,9 +7,6 @@ BASENAME=06-lwm2m-test
|
|||||||
|
|
||||||
IPADDR=fd00::302:304:506:708
|
IPADDR=fd00::302:304:506:708
|
||||||
|
|
||||||
echo "Enabling IPv6"
|
|
||||||
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
|
|
||||||
|
|
||||||
# Starting Contiki-NG native node
|
# Starting Contiki-NG native node
|
||||||
echo "Starting native node - lwm2m/ipso objects"
|
echo "Starting native node - lwm2m/ipso objects"
|
||||||
make -C $CONTIKI/examples/ipso-objects > make.log 2> make.err
|
make -C $CONTIKI/examples/ipso-objects > make.log 2> make.err
|
||||||
|
@ -67,24 +67,24 @@ WORKDIR ${HOME}
|
|||||||
RUN echo "#!/bin/bash\nant -Dbasedir=${COOJA} -f ${COOJA}/build.xml run" > ${HOME}/cooja && \
|
RUN echo "#!/bin/bash\nant -Dbasedir=${COOJA} -f ${COOJA}/build.xml run" > ${HOME}/cooja && \
|
||||||
chmod +x ${HOME}/cooja
|
chmod +x ${HOME}/cooja
|
||||||
|
|
||||||
# Optional: download Contiki-NG and pre-compile Cooja.
|
|
||||||
# Else, use a Docker bind mount to share the repo with the host.
|
|
||||||
# Docker run option:
|
|
||||||
# -v <HOST_CONTIKI_NG_ABS_PATH>:/home/user/contiki-ng
|
|
||||||
#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
|
|
||||||
|
|
||||||
# Enable IPv6 -- must be done at runtime, not in Dockerfile
|
|
||||||
#RUN sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
|
|
||||||
|
|
||||||
# Install coap-cli
|
# Install coap-cli
|
||||||
RUN sudo apt-get install -y npm \
|
RUN sudo apt-get install -y npm \
|
||||||
&& sudo apt-get clean \
|
&& sudo apt-get clean \
|
||||||
&& sudo npm install coap-cli -g \
|
&& sudo npm install coap-cli -g \
|
||||||
&& sudo ln -s /usr/bin/nodejs /usr/bin/node
|
&& sudo ln -s /usr/bin/nodejs /usr/bin/node
|
||||||
|
|
||||||
|
# Optional: download Contiki-NG and pre-compile Cooja.
|
||||||
|
# Else, use a Docker bind mount to share the repo with the host.
|
||||||
|
# Docker run option:
|
||||||
|
# -v <HOST_CONTIKI_NG_ABS_PATH>:/home/user/contiki-ng
|
||||||
|
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
|
||||||
|
|
||||||
# Working directory
|
# Working directory
|
||||||
WORKDIR ${CONTIKI_NG}
|
WORKDIR ${CONTIKI_NG}
|
||||||
|
|
||||||
|
# Enable IPv6 -- must be done at runtime, not in Dockerfile
|
||||||
|
RUN echo "sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 > /dev/null" >> /home/user/.profile
|
||||||
|
|
||||||
# Start a bash
|
# Start a bash
|
||||||
CMD bash
|
CMD bash --login
|
||||||
|
Loading…
Reference in New Issue
Block a user