diff --git a/docker/scripts/environment.sh b/docker/scripts/environment.sh index 0a31412..fcb1950 100755 --- a/docker/scripts/environment.sh +++ b/docker/scripts/environment.sh @@ -6,11 +6,13 @@ DESKTOP_ENVIRONMENT_DOMAIN_NAME=cloud.jacksondelahunt.com DESKTOP_ENVIRONMENT_REGISTRY=sabrehagen DESKTOP_ENVIRONMENT_USER=jackson DESKTOP_ENVIRONMENT_USER_HOME=/home/$DESKTOP_ENVIRONMENT_USER +DESKTOP_ENVIRONMENT_USER_ID=1000 echo DESKTOP_ENVIRONMENT_CONTAINER=$DESKTOP_ENVIRONMENT_CONTAINER echo DESKTOP_ENVIRONMENT_DOMAIN_NAME=$DESKTOP_ENVIRONMENT_DOMAIN_NAME echo DESKTOP_ENVIRONMENT_REGISTRY=$DESKTOP_ENVIRONMENT_REGISTRY echo DESKTOP_ENVIRONMENT_USER=$DESKTOP_ENVIRONMENT_USER echo DESKTOP_ENVIRONMENT_USER_HOME=$DESKTOP_ENVIRONMENT_USER_HOME +echo DESKTOP_ENVIRONMENT_USER_ID=$DESKTOP_ENVIRONMENT_USER_ID # Desktop environment docker configuration echo DESKTOP_ENVIRONMENT_DOCKER_NETWORK=$DESKTOP_ENVIRONMENT_REGISTRY-$DESKTOP_ENVIRONMENT_CONTAINER diff --git a/docker/scripts/take-ownership.sh b/docker/scripts/take-ownership.sh index e2c3d62..322a932 100755 --- a/docker/scripts/take-ownership.sh +++ b/docker/scripts/take-ownership.sh @@ -14,8 +14,8 @@ for VOLUME_NAME in $DESKTOP_ENVIRONMENT_VOLUMES; do --rm \ --user root \ --volume $VOLUME_NAME:$VOLUME_PATH \ - $DESKTOP_ENVIRONMENT_REGISTRY/$DESKTOP_ENVIRONMENT_CONTAINER:$DESKTOP_ENVIRONMENT_BRANCH \ - chown -R $DESKTOP_ENVIRONMENT_USER:$DESKTOP_ENVIRONMENT_USER $VOLUME_PATH & + alpine:latest \ + chown -R $DESKTOP_ENVIRONMENT_USER_ID:$DESKTOP_ENVIRONMENT_USER_ID $VOLUME_PATH & done diff --git a/host/bootstrap.sh b/host/bootstrap.sh index a8315c6..6ac7522 100755 --- a/host/bootstrap.sh +++ b/host/bootstrap.sh @@ -63,34 +63,29 @@ curl -sSL git.io/antigen > /usr/local/bin/antigen.zsh # Allow docker containers to access the host's X server xhost local:docker -# Host user configuration -HOST_USER=$DESKTOP_ENVIRONMENT_USER -HOST_USER_ID=1000 -HOST_REPOSITORY=/$DESKTOP_ENVIRONMENT_CONTAINER - # Remove existing user with host user id -userdel --force $(getent passwd $HOST_USER_ID | cut -d : -f 1) +userdel --force $(getent passwd $DESKTOP_ENVIRONMENT_USER_ID | cut -d : -f 1) # Create the host user useradd \ - --gid $HOST_USER_ID \ - --uid $HOST_USER_ID \ - $HOST_USER + --gid $DESKTOP_ENVIRONMENT_USER_ID \ + --uid $DESKTOP_ENVIRONMENT_USER_ID \ + $DESKTOP_ENVIRONMENT_USER # Give the host user access to required tools usermod \ --append \ --groups docker,sudo \ - $HOST_USER + $DESKTOP_ENVIRONMENT_USER # Install dotfiles configuration for host user -gosu $HOST_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-alacritty.git -gosu $HOST_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-autostart.git -gosu $HOST_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-git.git -gosu $HOST_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-kde.git -gosu $HOST_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-scripts.git -gosu $HOST_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-tilda.git -gosu $HOST_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-zsh.git +gosu $DESKTOP_ENVIRONMENT_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-alacritty.git +gosu $DESKTOP_ENVIRONMENT_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-autostart.git +gosu $DESKTOP_ENVIRONMENT_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-git.git +gosu $DESKTOP_ENVIRONMENT_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-kde.git +gosu $DESKTOP_ENVIRONMENT_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-scripts.git +gosu $DESKTOP_ENVIRONMENT_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-tilda.git +gosu $DESKTOP_ENVIRONMENT_USER vcsh clone https://sabrehagen@github.com/sabrehagen/dotfiles-zsh.git # Pre-cache development environment container docker pull --quiet $DESKTOP_ENVIRONMENT_REPOSITORY/$DESKTOP_ENVIRONMENT_CONTAINER_NAME:$DESKTOP_ENVIRONMENT_BRANCH