Simplification and cleanup of build process
[genesis.git] / fuel-build / docker / ubuntu-builder / setcontext
old mode 100755 (executable)
new mode 100644 (file)
similarity index 59%
rename from fuel-build/docker/ubuntu-builder/install.sh
rename to fuel-build/docker/ubuntu-builder/setcontext
index 667ab27..bc28994
@@ -8,15 +8,13 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
+#
+SETUSER=$1
+SETUID=$2
+SETGID=$3
+SETHOME=$4
 
-BASE_PACKAGES="make python-setuptools python-all dpkg-dev debhelper
-fuseiso git genisoimage bind9-host wget curl lintian tmux lxc iptables
-ca-certificates"
-
-apt-get update || exit 1
-apt-get upgrade -y || exit 1
-
-apt-get install -y $BASE_PACKAGES || exit 1
-
-echo "ALL ALL=NOPASSWD: ALL" > /etc/sudoers.d/open-sudo
-chmod 0440 /etc/sudoers.d/open-sudo
+getent group $SETUSER || /usr/sbin/groupadd --gid $SETGID $SETUSER
+getent passwd $SETUSER || /usr/sbin/adduser --system --uid=$SETUID --gid=$SETGID --home $SETHOME --shell /bin/bash $SETUSER
+/usr/sbin/usermod -a -G fuse $SETUSER
+exit 0