This commit is contained in:
Jackson Delahunt 2019-01-14 18:18:56 +11:00
parent ed972ed18b
commit 786724a550
4 changed files with 23 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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