From 78cb610f9d505170c113f921036c34b92a27dabc Mon Sep 17 00:00:00 2001 From: Jackson Delahunt Date: Mon, 14 Jan 2019 10:18:29 +1100 Subject: [PATCH] workinggggg --- Dockerfile | 18 +++++++++++------- scripts/exec.sh | 2 +- scripts/refresh.sh | 3 --- scripts/start.sh | 3 +++ 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 603d128..240468f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,18 +12,19 @@ ENV STEMN_TMUX_SESSION desktop-environment # Make the user's workspace directory RUN mkdir /$USER -# Rename the first non-root user to jackson -RUN usermod \ - --home $HOME \ - --login $USER \ - --move-home \ - $BASE_USER - # Rename the first non-root group to jackson RUN groupmod \ --new-name \ $USER $BASE_USER +# Rename the first non-root user to jackson +RUN usermod \ + --home $HOME \ + --groups docker \ + --login $USER \ + --move-home \ + $BASE_USER + # Install chrome RUN apt update && apt install --yes \ apt-transport-https \ @@ -69,6 +70,9 @@ RUN apt install --yes \ # Enable password-less sudo for user RUN echo "$USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers +# Clear and re-cache zsh plugins +RUN zsh -c "source antigen.zsh; antigen reset; source $HOME/.zshrc" + # Clone dotfiles configuration RUN alias https-to-git="sed 's;https://github.com/\(.*\);git@github.com:\1.git;'" RUN git clone https://github.com/sabrehagen/dotfiles-alacritty diff --git a/scripts/exec.sh b/scripts/exec.sh index 3a16ad5..196bfba 100755 --- a/scripts/exec.sh +++ b/scripts/exec.sh @@ -1,4 +1,4 @@ docker exec \ --interactive \ --tty \ - desktop-environment "$@" + desktop-environment zsh -c "$*" diff --git a/scripts/refresh.sh b/scripts/refresh.sh index 1583c3d..4e3ff97 100755 --- a/scripts/refresh.sh +++ b/scripts/refresh.sh @@ -8,8 +8,5 @@ sh $REPO_ROOT/scripts/stop.sh sh $REPO_ROOT/scripts/clean.sh sh $REPO_ROOT/scripts/start.sh -# Race condition causes new shell to fail if started too soon after container restart above -sleep 1 - # Enter the desktop environment sh $REPO_ROOT/scripts/shell.sh diff --git a/scripts/start.sh b/scripts/start.sh index a4e479d..6a13b69 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -39,3 +39,6 @@ docker run \ --volume JACKSON_HOME:$JACKSON_HOME \ --workdir $JACKSON_HOME \ sabrehagen/desktop-environment:latest + +# Wait until the container is running before proceeding +until docker inspect desktop-environment | grep Status | grep -m 1 "running" >/dev/null; do sleep 1 ; done