When I first start an application that I know will use docker, I like to avoid having to install ANY dependency that project has. Docker is great for this, because I can create a linked setup / staging environment.
But, I’m also not really willing to give up some of the things I’ve done to make my terminal experience better. For this, I use OhMyZsh…
# Staging Container
FROM node:8.12.0
# Set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
# Add app
COPY . /usr/src/app
# Install Zsh to make life easier
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "zsh"]
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
# Add any global dependencies you need
# RUN npm install -g @angular/cli
CMD ["zsh"]Once you have this Dockerfile in your application directory, you will need to build the image.
docker build . -t stagingThe -t param lets you alias your staging image. In this case, we have given it the alias “staging”.
And finally, to get into the staging image and start your zsh journey…
docker run --rm -it staging -v "$PWD":/usr/src/app






Leave a Reply