Created
March 25, 2017 05:05
-
-
Save realchrisolin/002a940154d0206374b4c3e13d19a635 to your computer and use it in GitHub Desktop.
Generic Ubuntu dev environment Dockerfile
This file contains hidden or 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
# Use Xenial as a base image | |
FROM ubuntu:16.04 | |
# Fix ReadLine warnings | |
ENV TERM linux | |
# Install apt based dependencies required to run Rails as | |
# well as RubyGems. As the Ruby image itself is based on a | |
# Debian image, we use apt-get to install those. | |
RUN apt-get update && apt-get install -y \ | |
apt-utils \ | |
sudo \ | |
build-essential \ | |
nodejs \ | |
bundler \ | |
vim \ | |
dialog | |
# Configure the main working directory. This is the base | |
# directory used in any further RUN, COPY, and ENTRYPOINT | |
# commands. | |
RUN useradd -ms /bin/bash ubuntu | |
RUN usermod -a -G sudo ubuntu | |
USER ubuntu | |
WORKDIR /home/ubuntu | |
# Configure sudoers file | |
USER root | |
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers | |
# Copy the main application. | |
COPY . ./ | |
# Expose specified port to the Docker host, so we can access it | |
# from the outside. | |
EXPOSE 4567 | |
# Install sinatra | |
USER ubuntu | |
RUN sudo gem install sinatra | |
# The main command to run when the container starts. Also | |
# tell the Rails dev server to bind to all interfaces by | |
# default. | |
# CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment