Skip to content

Commit 7054bce

Browse files
committed
new method for docker admin under unix
1 parent d8d64c3 commit 7054bce

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

bin/install

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ if [ "$NOT_ADMIN" = "1" ]; then
2525
echo "Compiling netkit_dw"
2626
sudo gcc -std=c99 $NETKIT_HOME/wrapper/netkit_dw.c -o $NETKIT_HOME/wrapper/bin/netkit_dw
2727
else
28-
echo -e "\033[0;33mAdmin mode\033[0m: bypassing netkit_dw with empty wrapper"
29-
echo -e "\033[0;31mWARNING: unsafe installation, this will create a softlink to /usr/bin/docker as the wrapper.\033[0m"
30-
echo -e "\033[0;31mAlso the software will NOT work until your user is in the docker group or you set correct permissions to docker (SUID and root).\033[0m"
28+
echo -e "\033[0;33mAdmin mode\033[0m"
29+
echo -e "\033[0;31mWARNING: unsafe installation, this will not create a wrapper and remove it if previously installed.\033[0m"
30+
echo -e "\033[0;31mYou will need to use 'sudo true' before using commands and set the env variable NETKIT_ADMIN to 1.\033[0m"
3131
sudo rm $NETKIT_HOME/wrapper/bin/netkit_dw
32-
sudo ln -s /usr/bin/docker $NETKIT_HOME/wrapper/bin/netkit_dw
3332
fi
3433

3534
echo "Setting permissions"

bin/python/netkit_commons.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
if PLATFORM != WINDOWS:
3636
DOCKER_BIN = os.environ['NETKIT_HOME'] + '/wrapper/bin/netkit_dw'
37+
if os.environ['NETKIT_ADMIN'] == '1' and PLATFORM != WINDOWS:
38+
DOCKER_BIN = 'sudo docker'
3739

3840
SEPARATOR_WINDOWS = ' & '
3941
BASH_SEPARATOR = ' ; '

0 commit comments

Comments
 (0)