#
# Ubuntu Dockerfile
#
# https://github.com/dockerfile/ubuntu
# 
# // first build the image based on this dockerfile. From the same dir of this file run
# docker build -t eae-ubuntu-generic .
# // now run the container based on the image eae-ubuntu-generic 
# docker run -d --name bucherer-dev -v /var/www/bucherer:/var/www -p 1027:22 -p 1028:80 eae-ubuntu-generic
#

# Pull base image.
FROM ubuntu:14.04

RUN apt-get -y update && \
    apt-get -y upgrade && \
    apt-get -y install curl 

  
RUN mkdir /var/run/sshd
RUN chmod 0755 /var/run/sshd
RUN useradd --create-home --shell /bin/bash --groups sudo eae ## includes 'sudo'
RUN echo "root:p4ssw0rd" | chpasswd
RUN echo "eae:p4ssw0rd" | chpasswd
#RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# Add authorized_keys
RUN mkdir /root/.ssh

# SSH login fix. Otherwise user is kicked off after login
#RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile

#RUN curl –sS https://getcomposer.org/installer | php
#RUN mv composer.phar /usr/local/bin/composer

RUN apt-get install apt-transport-https
RUN curl https://repo.varnish-cache.org/GPG-key.txt | apt-key add -
RUN echo "deb https://repo.varnish-cache.org/debian/ jessie varnish-4.1"\
    >> /etc/apt/sources.list.d/varnish-cache.list
RUN apt-get update
RUN apt-get install varnish

EXPOSE 80
CMD ["service varnish start"]
