From 026a2e35488a7d790c53a65e80cb6be3815d7d15 Mon Sep 17 00:00:00 2001 From: starlord Date: Mon, 29 May 2017 11:20:39 +0200 Subject: [PATCH] Corrected yocto image and run script --- yocto/Dockerfile | 2 +- yocto/yocto | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/yocto/Dockerfile b/yocto/Dockerfile index ecf9d5a..5c4b516 100644 --- a/yocto/Dockerfile +++ b/yocto/Dockerfile @@ -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' diff --git a/yocto/yocto b/yocto/yocto index 4a9bcb5..0e041ad 100755 --- a/yocto/yocto +++ b/yocto/yocto @@ -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() @@ -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 $@)"