Created
June 6, 2017 18:36
-
-
Save jaanli/2103cad66e98c9054f64412b4b96cf6f to your computer and use it in GitHub Desktop.
Dockerfile for dotfiles with vim + tmux + c++ dev environment & private github ssh key support. Using dotfiles from https://github.com/altosaar/dotfiles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fixed ubuntu version | |
FROM ubuntu:16.04 | |
# Install Ruby and Rails dependencies | |
RUN apt-get update && apt-get install -y \ | |
tmux \ | |
gdb \ | |
gcc \ | |
g++ \ | |
python \ | |
pkg-config \ | |
clang-format \ | |
libgsl2 \ | |
libgsl-dev \ | |
libarmadillo6 \ | |
libarmadillo-dev \ | |
libboost-all-dev \ | |
vim-nox \ | |
tmux \ | |
zsh \ | |
autojump \ | |
keychain \ | |
sudo \ | |
git | |
# Set neovim as default editor | |
# RUN update-alternatives --install /usr/bin/editor editor /usr/bin/vim 60 && \ | |
# update-alternatives --config editor && \ | |
# update-alternatives --install /usr/bin/vi vi /usr/bin/vim 60 && \ | |
# update-alternatives --config vi && \ | |
# update-alternatives --install /usr/bin/vim vim /usr/bin/vim 60 && \ | |
# update-alternatives --config vim | |
# Add the user, with passwordless sudo | |
RUN useradd --user-group \ | |
--create-home \ | |
--shell /usr/bin/zsh \ | |
jaan && \ | |
echo 'jaan ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | |
# Switch to user and home directory | |
USER jaan | |
ENV HOME /home/jaan | |
WORKDIR /home/jaan | |
# Setup for ssh onto github | |
RUN mkdir -p $HOME/.ssh | |
ADD id_rsa $HOME/.ssh/id_rsa | |
ADD id_rsa.pub $HOME/.ssh/id_rsa.pub | |
RUN sudo chown jaan:jaan $HOME/.ssh | |
RUN sudo chmod 777 $HOME/.ssh/id_rsa | |
RUN sudo chmod 777 $HOME/.ssh/id_rsa.pub | |
RUN echo "Host github.com\n\tStrictHostKeyChecking no\n" >> $HOME/.ssh/config | |
RUN ssh-keyscan -t rsa github.com 2>&1 >> $HOME/.ssh/known_hosts | |
# Install oh-my-zsh | |
RUN git clone git://github.com/robbyrussell/oh-my-zsh.git .oh-my-zsh | |
RUN git config --global user.email [email protected] && \ | |
git config --global user.name altosaar | |
# Clone dotfiles | |
RUN git clone --bare git://github.com/altosaar/dotfiles.git $HOME/.cfg | |
RUN echo "alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> $HOME/.zshrc | |
# need to run config submodule update --init from within docker | |
# RUN /usr/bin/zsh -c "source $HOME/.zshrc" | |
# vim | |
RUN git clone https://github.com/VundleVim/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim | |
# need to run :PluginInstall from vim | |
# RUN vim -c ':PluginInstall' -c 'qa!' | |
# Share the work volume | |
VOLUME ["/home/jaan"] | |
# Run zsh as login shell | |
ENTRYPOINT ["/usr/bin/zsh"] | |
CMD ["--login"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment