anchor.diff:  ENV NRF52_SDK_ROOT /usr/nrf52-sdk
   
   # Upgrade pip to latest version
  +# Install IoT-Lab cli-tools and ssh-cli-tools
   RUN pip -q install --upgrade pip
  -RUN pip -q install setuptools
  +RUN pip -q install setuptools && \
  +        pip install iotlabcli==2.5.4 && iotlabsshcli==0.2.3
   
  -# Install IoT-Lab cli-tools and ssh-cli-tools
  -RUN pip install iotlabcli==2.5.4 && iotlabsshcli==0.2.3
  +# Add a script that we will use to correct permissions after running certain commands
  +ADD fix-permissions /usr/local/bin/
  +
  +# Set environment variables
  +ENV JAVA_HOME           /usr/lib/jvm/default-java
  +ENV HOME                /home/${USER}
  +ENV WORK                ${HOME}/work
  +ENV CONTIKI             ${HOME}/contiki
  +ENV COOJA               ${CONTIKI}/tools/cooja
  +ENV                     PATH="${HOME}:${PATH}"
   
   # Create user, enable X forwarding, add to group dialout
   # -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix
  -RUN export uid=1000 gid=1000 && \
  -    mkdir -p /home/${username} && \
  -    echo "${username}:x:${uid}:${gid}:${username},,,:/home/${username}:/bin/bash" >> /etc/passwd && \
  -    echo "${username}:x:${uid}:" >> /etc/group && \
  -    echo "${username} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers && \
  +RUN useradd -m -s /bin/bash -N -u $UID $USER && \
  +    echo "${USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers && \
       chmod 0440 /etc/sudoers && \
  -    chown ${uid}:${gid} -R /home/${username} && \
  -    usermod -aG dialout ${username}
  +    chmod g+w /etc/passwd && \
  +    usermod -aG dialout $USER && \
  +    fix-permissions $HOME
   
  -# Set user for what comes next
  -USER ${username}
  +# Set user and workdir for what comes next
  +USER ${UID}
  +WORKDIR ${HOME}
   
  -# Environment variables
  -ENV JAVA_HOME           /usr/lib/jvm/default-java
  -ENV HOME                /home/${username}
  -ENV CONTIKI             ${HOME}/contiki
  -ENV COOJA               ${CONTIKI}/tools/cooja
  -ENV                     PATH="${HOME}:${PATH}"
  -WORKDIR                 ${HOME}
  -
  -# Create Cooja shortcut
  +# Create Cooja shortcut and work directory
   RUN echo "#!/bin/bash\nant -Dbasedir=${COOJA} -f ${COOJA}/build.xml run" > ${HOME}/cooja && \
  -  chmod +x ${HOME}/cooja
  +  chmod +x ${HOME}/cooja && \
  +  mkdir $WORK
   
   # Download, build and install Renode
   RUN git clone --quiet https://github.com/renode/renode.git \
  
positive.code: LABEL maintainer="Felipe Lalanne <flalanne@niclabs.cl>"
  
  ENV DEBIAN_FRONTEND noninteractive
  ARG username=user
  
  # Tools
  RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
  
negative.code: 
  # Upgrade contiki source
  RUN cd ${CONTIKI} && \
          git config user.email "devel@niclabs.cl" && \
          git config user.name "NIC Labs Devel" && \
          git remote add contiki https://github.com/contiki-os/contiki.git && \
          git fetch contiki && \
          git merge --no-edit contiki/master
  
  # Build cooja and fix all permissions
  RUN ANT_OPTS=-Dfile.encoding=utf8 ant -q -f ${COOJA}/build.xml jar && \
          fix-permissions $HOME
  
  # 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
  
  USER root
  
  ENTRYPOINT ["entrypoint.sh"]
  CMD ["bash"]
  
  # Add local files as late as possible to avoid cache busting
  COPY entrypoint.sh /usr/local/bin/
  
  # Set workdir and switch back to dev to avoid accidental container runs as root
  WORKDIR $WORK
  USER ${UID}
  