Skip to content

Commit

Permalink
Corrected yocto image and run script
Browse files Browse the repository at this point in the history
  • Loading branch information
starlord committed May 29, 2017
1 parent 93d1da3 commit 026a2e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion yocto/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ RUN apt-get update -yqq \
&& apt-get install -yqq gawk wget git-core diffstat unzip texinfo \
gcc-multilib build-essential chrpath socat \
libsdl1.2-dev xterm python3 locales \
sudo cpio \
sudo cpio qemu iptables \
&& locale-gen en_US.UTF-8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
5 changes: 3 additions & 2 deletions yocto/yocto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ create_user_cmd()
groupadd -f -g ${GROUP_ID} ${CONTAINER_GROUPNAME} '&&' \
useradd -u ${USER_ID} -g ${CONTAINER_GROUPNAME} ${CONTAINER_USERNAME} '&&' \
mkdir --parent ${HOMEDIR} '&&' \
chown -R ${CONTAINER_USERNAME}:${CONTAINER_GROUPNAME} ${HOMEDIR}
chown -R ${CONTAINER_USERNAME}:${CONTAINER_GROUPNAME} ${HOMEDIR} '&&' \
echo $CONTAINER_USERNAME ALL=NOPASSWD: ALL '>> /etc/sudoers'
}

execute_as_cmd()
Expand All @@ -24,6 +25,6 @@ full_container_cmd()
echo "$(create_user_cmd) && $(execute_as_cmd) $@"
}

docker run -it --rm -v "$(pwd)":"${HOMEDIR}" -w "${HOMEDIR}" "${DOCKER_IMAGE}" /bin/bash -ci "$(full_container_cmd $@)"
docker run --privileged --cap-add=NET_ADMIN --device=/dev/net/tun -it --rm -v "$(pwd)":"${HOMEDIR}" -w "${HOMEDIR}" "${DOCKER_IMAGE}" /bin/bash -ci "$(full_container_cmd $@)"


0 comments on commit 026a2e3

Please sign in to comment.