github.com/leverly/deis@v1.0.2/builder/Dockerfile (about)

     1  FROM ubuntu-debootstrap:14.04
     2  
     3  ENV DEBIAN_FRONTEND noninteractive
     4  
     5  # install common packages
     6  RUN apt-get update && apt-get install -y curl net-tools sudo
     7  
     8  # install etcdctl
     9  RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/opdemand/etcdctl-v0.4.6 \
    10      && chmod +x /usr/local/bin/etcdctl
    11  
    12  # install confd
    13  RUN curl -sSL -o /usr/local/bin/confd https://s3-us-west-2.amazonaws.com/opdemand/confd-v0.5.0-json \
    14      && chmod +x /usr/local/bin/confd
    15  
    16  # install docker-in-docker
    17  RUN echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
    18  RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
    19  
    20  # install builder, docker, and hook dependencies
    21  RUN apt-get update && apt-get install -yq \
    22      openssh-server git \
    23      aufs-tools iptables lxc \
    24      lxc-docker-1.3.2
    25  
    26  # install jq for parsing json
    27  RUN curl http://stedolan.github.io/jq/download/linux64/jq > /usr/bin/jq && chmod 755 /usr/bin/jq
    28  
    29  # configure ssh server
    30  RUN rm /etc/ssh/ssh_host_*
    31  RUN dpkg-reconfigure openssh-server
    32  RUN mkdir -p /var/run/sshd
    33  
    34  # install pip
    35  RUN curl -sSL https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | python -
    36  
    37  # install hook dependencies
    38  RUN pip install pyyaml==3.11 requests==2.4.3
    39  
    40  # configure locale
    41  RUN echo LANG="en_US.UTF-8" > /etc/default/locale && dpkg-reconfigure locales
    42  
    43  # install git and configure gituser
    44  ENV GITHOME /home/git
    45  ENV GITUSER git
    46  RUN useradd -d $GITHOME $GITUSER
    47  RUN mkdir -p $GITHOME/.ssh && chown git:git $GITHOME/.ssh
    48  RUN chown -R $GITUSER:$GITUSER $GITHOME
    49  
    50  # let the git user run `sudo /home/git/builder` (not writeable)
    51  RUN echo "%git    ALL=(ALL:ALL) NOPASSWD:/home/git/builder" >> /etc/sudoers
    52  
    53  # HACK: import progrium/cedarish as a tarball
    54  # see https://github.com/deis/deis/issues/1027
    55  RUN curl -#SL -o /progrium_cedarish.tar \
    56      https://s3-us-west-2.amazonaws.com/opdemand/progrium_cedarish_2014_10_01.tar
    57  
    58  # define the execution environment
    59  # use VOLUME to remove /var/lib/docker from copy-on-write for performance
    60  # we don't want to stack overlay filesystems
    61  VOLUME /var/lib/docker
    62  WORKDIR /app
    63  ENTRYPOINT ["/app/bin/entry"]
    64  CMD ["/app/bin/boot"]
    65  EXPOSE 22
    66  RUN addgroup --quiet --gid 2000 slug && useradd slug --uid=2000 --gid=2000
    67  
    68  ADD templates/shim.dockerfile /home/git/
    69  ADD . /app
    70  ADD sshd_config /etc/ssh/sshd_config
    71  RUN chown -R root:root /app