aboutsummaryrefslogtreecommitdiff
path: root/docker/debian-dev/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'docker/debian-dev/bootstrap')
-rwxr-xr-xdocker/debian-dev/bootstrap/apt-source/get-domain.bash1
-rwxr-xr-xdocker/debian-dev/bootstrap/apt-source/setup.bash5
-rwxr-xr-xdocker/debian-dev/bootstrap/setup-user.bash9
-rwxr-xr-xdocker/debian-dev/bootstrap/setup.bash1
4 files changed, 12 insertions, 4 deletions
diff --git a/docker/debian-dev/bootstrap/apt-source/get-domain.bash b/docker/debian-dev/bootstrap/apt-source/get-domain.bash
index c9b93b1..d44ea65 100755
--- a/docker/debian-dev/bootstrap/apt-source/get-domain.bash
+++ b/docker/debian-dev/bootstrap/apt-source/get-domain.bash
@@ -3,4 +3,3 @@
set -e
sed "s|.*https\?://\([-_.a-zA-Z0-9]\+\)/.*|\\1|;q" /etc/apt/sources.list
-
diff --git a/docker/debian-dev/bootstrap/apt-source/setup.bash b/docker/debian-dev/bootstrap/apt-source/setup.bash
index 36065f6..60e635b 100755
--- a/docker/debian-dev/bootstrap/apt-source/setup.bash
+++ b/docker/debian-dev/bootstrap/apt-source/setup.bash
@@ -2,12 +2,11 @@
set -e
-dir=$(dirname $0)
+dir=$(dirname "$0")
if [[ -n $IN_CHINA ]]; then
- "$dir/replace-domain.bash" $(cat "$dir/china-source.txt")
+ "$dir/replace-domain.bash" "$(cat "$dir/china-source.txt")"
fi
"$dir/install-apt-https.bash"
"$dir/replace-http.bash"
-
diff --git a/docker/debian-dev/bootstrap/setup-user.bash b/docker/debian-dev/bootstrap/setup-user.bash
new file mode 100755
index 0000000..0eccde4
--- /dev/null
+++ b/docker/debian-dev/bootstrap/setup-user.bash
@@ -0,0 +1,9 @@
+#! /usr/bin/env bash
+
+set -e
+
+apt-get install -y sudo
+
+sed -i.bak 's|%sudo[[:space:]]\+ALL=(ALL:ALL)[[:space:]]\+ALL|%sudo ALL=(ALL:ALL) NOPASSWD: ALL|' /etc/sudoers
+
+useradd -m -G sudo -s /usr/bin/bash "$USERNAME"
diff --git a/docker/debian-dev/bootstrap/setup.bash b/docker/debian-dev/bootstrap/setup.bash
index 2aa88e0..c72db87 100755
--- a/docker/debian-dev/bootstrap/setup.bash
+++ b/docker/debian-dev/bootstrap/setup.bash
@@ -5,6 +5,7 @@ set -e
export DEBIAN_FRONTEND=noninteractive
/bootstrap/apt-source/setup.bash
+/bootstrap/setup-user.bash
/bootstrap/setup-base.bash
/bootstrap/setup-dev.bash