Skip to content

Instantly share code, notes, and snippets.

@grahamg
Last active May 10, 2020 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamg/86f512a70c72eeac444a841f41ba0a97 to your computer and use it in GitHub Desktop.
Save grahamg/86f512a70c72eeac444a841f41ba0a97 to your computer and use it in GitHub Desktop.
Dockerfile for local development environment.
#
# mkdir DockerLocalDevelopmentEnvironment
# curl -o Dockerfile <this file>
# docker build -t dev-env .
# docker run -it -d dev-env:latest /bin/bash
# docker ps
# docker attach <randomly assigned instance name>
#
FROM phusion/baseimage:latest
MAINTAINER Graham Greenfield version: 1.1
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# Update packages and install general development packages.
RUN apt-get update
RUN apt-get -y install curl sudo wget htop build-essential
# Setup git and related tools.
RUN apt-get -y install git tig
RUN git config --global user.name "Graham Greenfield"
RUN git config --global user.email "grahamg@users.noreply.github.com"
RUN git config --global core.editor nvim
# Setup neovim and Vundle packages.
# RUN apt-get -y install neovim
# RUN mkdir -p ~/.config/nvim/bundle
# RUN git clone https://github.com/VundleVim/Vundle.vim.git ~/.config/nvim/bundle/Vundle.vim
# RUN curl -o ~/.config/nvim/init.vim https://gist.githubusercontent.com/grahamg/8d1728fb20b6ac3e1ebf3dcb80247b3c/raw/4d18acbc61428add359ee46ab561265c87e76443/init.vim
# Setup python3.
RUN apt-get -y install python3
RUN apt-get -y install python3-pip
RUN pip3 install pipenv
# Setup python2.
#RUN apt-get -y install python2
#RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
#RUN python2 get-pip.py
#RUN pip2 install virtualenv
#RUN pip2 install pipenv
# Install terminal multiplexers and their associated configuration files.
RUN apt-get -y install screen tmux
# Prevents 'sudo: setrlimit(RLIMIT_CORE): Operation not permitted' messages.
RUN echo "Set disable_coredump false" >> /etc/sudo.conf
# Baseimage-docker disables the SSH server by default, this reverses that setting.
RUN rm -f /etc/service/sshd/down
# Regenerate SSH host keys. baseimage-docker does not contain any, so you
# have to do that yourself. You may also comment out this instruction; the
# init system will auto-generate one during boot.
RUN /etc/my_init.d/00_regen_ssh_host_keys.sh
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
CMD ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment