anchor.diff: -# ssh
  -#
  -# VERSION               0.0.1
  +## hadoop base  setup docker file
  +##
  +## VERSION		:0.0.4
  +## DATE			:22Jul2015
   
   # FROM centos:6.6
  -FROM centos/centos:6.6
  +FROM local/hadoopbase:v1
   MAINTAINER mystique <b4wt@quantumfoam.uni.me>
  +
   
   # LABEL Description="This image installs ssh daemon on base centos:6.6 image" Vendor="Miztiik Corp" Version="1.0"
   
  -# Source from : https://docs.docker.com/examples/running_ssh_service/
  +
  +# Ref [1]	:	https://docs.docker.com/examples/running_ssh_service/
  +# Ref [2]	:	https://registry.hub.docker.com/u/sequenceiq/hadoop-docker/dockerfile/
  +
  +
  +# Setup yum to use caching in the shared folder to allow it to be reused by multiple systems, number of copies to 3
  +RUN sed -ri 's/keepcache=0/keepcache=1/g' /etc/yum.conf
  +RUN sed -ri 's/installonly_limit=5/installonly_limit=3/g' /etc/yum.conf
  +
  +# Enable the fastest mirror
  +RUN sed -ri 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
  +
  +# Have to really escape the special chracters will back slashes, probably should find a neater way of doing this, (laterz..)
  +RUN sed -ri 's/cachedir=\/var\/cache\/yum\/\$basearch\/\$releasever/cachedir=\/media\/sf_dockerRepos\/dockerTmp\/yum\/\$basearch\/\$releasever/g' /etc/yum.conf
   
   # Lets install the necessary binaries
   RUN yum install -y epel-release \
  
positive.code: passwd \
  openssh openssh-server \
  openssh-clients \
  sudo
  
  RUN yum clean all
  
  RUN mkdir /var/run/sshd
  
  
negative.code: RUN echo 'hadoopadmin:tcuser' | chpasswd
  RUN echo '%wheel ALL=(ALL) ALL' >> /etc/sudoers
  
  # Set up SSH passwordless ssh ( First time start up of sshd will create these keys)
  # RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key
  # RUN ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key
  # RUN ssh-keygen -q -N "" -t rsa -f /root/.ssh/id_rsa
  # RUN cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
  
  RUN mkdir -p /home/hadoopadmin/.ssh
  ADD authorized_keys /home/hadoopadmin/.ssh/
  RUN chmod 600 /home/hadoopadmin/.ssh/authorized_keys; chmod 700 /home/hadoopadmin/.ssh
  