Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions build/docker_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ cp -R /root/.oh-my-zsh $USER_HOME
chown -R $HOST_UID:$HOST_GID $USER_HOME
ln -s /home/user /home/$HOST_USERNAME

# Check for Docker-in-Docker and set user permissions
ds="/var/run/docker.sock"
if [ -S $ds ]; then
dgid=$(stat -c '%g' $ds)
grep -q "$dgid" /etc/group || groupadd -g "$dgid" dddocker
usermod -aG "$dgid" "$HOST_USERNAME"
fi

# su user -c /bin/bash
# su -l -c /bin/bash user
su - "$HOST_USERNAME"
1 change: 1 addition & 0 deletions build/feature_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apt-get install -y docker.io || die "error install docker"
11 changes: 11 additions & 0 deletions docker-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ else
DOCKER_OPTS="$DOCKER_OPTS -e AWS_PROFILE=$SITE_NAME"
fi

if echo "$DOCKERDEV_FEATURES" |grep -q docker; then
echo "Docker-in-Docker feature enabled"
ds=/var/run/docker.sock
if [ -S "$ds" ]; then
echo "Mounting Docker socket within container."
DOCKER_OPTS="$DOCKER_OPTS -v $ds:$ds"
else
echo "Docker socket not found. Docker will not be available within the container."
fi
fi

# DOCKER_OPTS="$DOCKER_OPTS -u 0:1000"

#
Expand Down