From 786724a5500feb883ea2c3037c6fbe72b9f3fa12 Mon Sep 17 00:00:00 2001 From: Jackson Delahunt Date: Mon, 14 Jan 2019 18:18:56 +1100 Subject: [PATCH] volumes --- scripts/bootstrap-host.sh | 18 +++++++++++------- scripts/bootstrap-volumes.sh | 9 +++++++++ scripts/clean-hard.sh | 1 + scripts/start.sh | 2 ++ 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/scripts/bootstrap-host.sh b/scripts/bootstrap-host.sh index 974e0c4..3946d7b 100755 --- a/scripts/bootstrap-host.sh +++ b/scripts/bootstrap-host.sh @@ -29,6 +29,11 @@ usermod -aG docker $HOST_USER # Allow connections from docker containers to the host's X server xhost local:docker +# Install utilities +apt update && apt install --yes && \ + docker.io && \ + vcsh + # Enable password-less sudo for the host user echo "$HOST_USER ALL=(ALL) NOPASSWD:ALL" | tee -a /etc/sudoers @@ -37,11 +42,10 @@ wget -O alacritty.deb https://github.com/jwilm/alacritty/releases/download/v0.2. dpkg -i alacritty.deb && \ rm alacritty.deb -# Install latest alacritty configuration for host user -ALACRITTY_CONFIG=$HOST_HOME/.config/alacritty/alacritty.yml -mkdir -p $(dirname $ALACRITTY_CONFIG) && \ - wget -q -O $ALACRITTY_CONFIG https://raw.githubusercontent.com/sabrehagen/dotfiles-alacritty/master/.config/alacritty/alacritty.yml && \ - chown $HOST_USER:$HOST_USER $ALACRITTY_CONFIG +# Take ownership of all files under the user's directory +chown $HOST_USER:$HOST_USER /$HOST_USER -# Swap escape and capslock keys -setxkbmap -option caps:swapescape +# Install dotfiles configuration for host user +su $HOST_USER +vcsh clone https://github.com/sabrehagen/dotfiles-alacritty.git +vcsh clone https://github.com/sabrehagen/dotfiles-scripts.git diff --git a/scripts/bootstrap-volumes.sh b/scripts/bootstrap-volumes.sh index 50b8884..3cdd0b3 100755 --- a/scripts/bootstrap-volumes.sh +++ b/scripts/bootstrap-volumes.sh @@ -2,6 +2,7 @@ CONTAINER_USER=jackson JACKSON_CONFIG_CHROME=/$CONTAINER_USER/home/.config/google-chrome JACKSON_CONFIG_CODE=/$CONTAINER_USER/home/.config/Code +JACKSON_CONFIG_GITHUB=/$CONTAINER_USER/home/.config/hub # Give the container user ownership of the JACKSON_CONFIG_CHROME volume docker run \ @@ -18,3 +19,11 @@ docker run \ --volume JACKSON_CONFIG_CODE:$JACKSON_CONFIG_CODE \ sabrehagen/desktop-environment:latest \ chown -R $CONTAINER_USER:$CONTAINER_USER $JACKSON_CONFIG_CODE + +# Give the container user ownership of the JACKSON_CONFIG_GITHUB volume +docker run \ + --rm \ + --user root \ + --volume JACKSON_CONFIG_GITHUB:$JACKSON_CONFIG_GITHUB \ + sabrehagen/desktop-environment:latest \ + chown -R $CONTAINER_USER:$CONTAINER_USER $JACKSON_CONFIG_GITHUB diff --git a/scripts/clean-hard.sh b/scripts/clean-hard.sh index c4db9d5..594df2b 100755 --- a/scripts/clean-hard.sh +++ b/scripts/clean-hard.sh @@ -6,3 +6,4 @@ sh $REPO_ROOT/scripts/clean.sh # Remove volumes that can be recreated from scratch, but require manual configuration in app docker volume rm JACKSON_CONFIG_CODE docker volume rm JACKSON_CONFIG_CHROME +docker volume rm JACKSON_CONFIG_GITHUB diff --git a/scripts/start.sh b/scripts/start.sh index 6a13b69..04867d0 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -15,6 +15,7 @@ docker run \ --env SSH_AUTH_SOCK=$JACKSON_HOME/.ssh/auth.sock \ --env STEMN_GIT_EMAIL="$(git config --get user.email)" \ --env STEMN_GIT_NAME="$(git config --get user.name)" \ + --env STEMN_TMUX_SESSION=desktop-session \ --group-add audio \ --group-add video \ --interactive \ @@ -36,6 +37,7 @@ docker run \ --volume ${SSH_AUTH_SOCK-$HOME/.ssh/auth.sock}:$JACKSON_HOME/.ssh/auth.sock \ --volume JACKSON_CONFIG_CHROME:$JACKSON_HOME/.config/google-chrome \ --volume JACKSON_CONFIG_CODE:$JACKSON_HOME/.config/Code \ + --volume JACKSON_CONFIG_GITHUB:$JACKSON_HOME/.config/hub \ --volume JACKSON_HOME:$JACKSON_HOME \ --workdir $JACKSON_HOME \ sabrehagen/desktop-environment:latest