Skip to content

Instantly share code, notes, and snippets.

@jonathan-ostrander
Created April 6, 2016 14:41
Show Gist options
  • Save jonathan-ostrander/c8d71167d0f1fc2f115b6c76ab9097f7 to your computer and use it in GitHub Desktop.
Save jonathan-ostrander/c8d71167d0f1fc2f115b6c76ab9097f7 to your computer and use it in GitHub Desktop.
Setting up oh-my-zsh in vagrant and docker
export ZSH=/home/vagrant/.oh-my-zsh
ZSH_THEME="miloshadzic"
alias ohmy="docker build -t bamx/base -f conf/webapp/OhMyDocker conf;"
alias whale="docker exec -it bamx_web_1 zsh"
plugins=(git)
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
source $ZSH/oh-my-zsh.sh
cd /opt/bamx
source /opt/bamx/conf/docker/aliases

In Vagrant,

sudo apt-get install zsh
chsh -s /bin/zsh # password is "vagrant"
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Copy the .zshrc file to the vagrant box and run source ~/.zshrc.

Copy the OhMyDocker file to conf/webapp. You'll want to add OhMyDocker to a global gitignore in vagrant.

Whenever updating docker containers,

make docker-pull-latest
ohmy
make up

In order to ssh into the docker web container, run whale.

FROM bamx/app:latest
RUN apt-get update && apt-get install -y zsh
RUN bash -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
ADD ~/.gitignore-global ~/.gitignore-global
RUN git config --global core.excludesfile ~/.gitignore-global
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment