This commit is contained in:
Jackson Delahunt 2019-01-13 14:58:30 +11:00
parent 3fe490555a
commit d7fa9354ea
5 changed files with 20 additions and 12 deletions

View file

@ -58,9 +58,6 @@ RUN wget -O rescuetime.deb -nv https://www.rescuetime.com/installers/rescuetime_
dpkg -i rescuetime.deb || apt --fix-broken --yes install && \
rm rescuetime.deb
# Remove mock sudo
RUN rm /usr/local/bin/sudo
# Install operating system utilities
RUN apt install --yes \
sudo \
@ -81,7 +78,7 @@ RUN git clone https://github.com/sabrehagen/dotfiles-zsh
# Add program configurations
COPY config/tmuxinator $HOME/.config/tmuxinator
COPY config/zsh/.zshenv $HOME/.zshenv.desktop
RUN echo 'source .zshenv.desktop' >> $HOME/.zshenv
RUN echo "source $HOME/.zshenv.desktop" >> $HOME/.zshenv
# Add custom binaries
COPY bin /usr/local/bin
@ -94,7 +91,11 @@ ARG CONTAINER_BUILD_DATE
ARG CONTAINER_GIT_SHA
ENV CONTAINER_BUILD_DATE $CONTAINER_BUILD_DATE
ENV CONTAINER_GIT_SHA $CONTAINER_GIT_SHA
ENV CONTAINER_IMAGE_NAME sabrehagen/desktop-environment
# Become the desktop user
USER $USER
WORKDIR $HOME
# Start the long-lived tmux session
ENTRYPOINT zsh -c "tmux -S $HOME/.tmux/tmux.sock new-session -d -s $STEMN_TMUX_SESSION && sleep infinity"

View file

@ -1,4 +1,2 @@
# Print container build info
CURRENT_DATE=$(date +%s)
TIME_SINCE_CONTAINER_BUILD=$(echo $((CURRENT_DATE-CONTAINER_BUILD_DATE)) | awk '{print int($1/(60 * 60 * 24))" days "int($1/(60 * 60))" hrs "int($1/60)" mins "int($1%60)" secs ago"}')
echo "\nContainer built $TIME_SINCE_CONTAINER_BUILD | sha $CONTAINER_GIT_SHA"
# Change to the most frequently used directory
cd $HOME/repositories/stemn/stemn-backend

View file

@ -1,6 +1,6 @@
REPO_ROOT=$(dirname $(realpath $0))/..
# Stop the running environment so there are no containers using the volumes
sh $REPO_ROOT/scripts/stop.sh
# Stop the running environment so there are no containers using the volumes, ignoring errors if it does not exist
sh $REPO_ROOT/scripts/stop.sh 2>/dev/null
docker volume rm JACKSON_HOME

View file

@ -1,5 +1,15 @@
REPO_ROOT=$(dirname $(realpath $0))/..
# Rebuild the desktop environment
sh $REPO_ROOT/scripts/build.sh
sh $REPO_ROOT/scripts/restart.sh
# Reset the desktop environment state
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

View file

@ -1,5 +1,4 @@
REPO_ROOT=$(dirname $(realpath $0))/..
sh $REPO_ROOT/scripts/stop.sh
sh $REPO_ROOT/scripts/clean.sh
sh $REPO_ROOT/scripts/start.sh