Skip to content

Commit

Permalink
Reduce no. of layers for DockerFile
Browse files Browse the repository at this point in the history
  • Loading branch information
sukrit007 committed Feb 18, 2015
1 parent ba89b5a commit 8971241
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,36 @@ FROM totem/python-base:2.7-trusty

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update --fix-missing
RUN apt-get install -y openssh-server openssh-client libffi-dev gettext libyaml-dev nano
RUN apt-get update --fix-missing && apt-get install -y \
openssh-server \
openssh-client \
libffi-dev \
gettext \
libyaml-dev \
nano

##SSH Server (To troubleshoot issues with discover)
RUN mkdir /var/run/sshd
RUN mkdir /root/.ssh
RUN chmod 500 /root/.ssh & chown -R root:root /root/.ssh
RUN mkdir /var/run/sshd && \
mkdir /root/.ssh && \
chmod 500 /root/.ssh && \
chown -R root:root /root/.ssh

#Syslog
RUN echo '$PreserveFQDN on' | cat - /etc/rsyslog.conf > /tmp/rsyslog.conf && sudo mv /tmp/rsyslog.conf /etc/rsyslog.conf
RUN sed -i 's~^#\$ModLoad immark\(.*\)$~$ModLoad immark \1~' /etc/rsyslog.conf
RUN echo '$PreserveFQDN on' | cat - /etc/rsyslog.conf > /tmp/rsyslog.conf && \
sudo mv /tmp/rsyslog.conf /etc/rsyslog.conf && \
sed -i 's~^#\$ModLoad immark\(.*\)$~$ModLoad immark \1~' /etc/rsyslog.conf

#Confd
ENV CONFD_VERSION 0.6.2
RUN curl -L https://github.com/kelseyhightower/confd/releases/download/v$CONFD_VERSION/confd-${CONFD_VERSION}-linux-amd64 -o /usr/local/bin/confd
RUN chmod 555 /usr/local/bin/confd
RUN curl -L https://github.com/kelseyhightower/confd/releases/download/v$CONFD_VERSION/confd-${CONFD_VERSION}-linux-amd64 -o /usr/local/bin/confd && \
chmod 555 /usr/local/bin/confd

#Etcdctl
RUN echo "Etcd force...."
ENV ETCDCTL_VERSION v0.4.6
RUN curl -L https://github.com/coreos/etcd/releases/download/$ETCDCTL_VERSION/etcd-$ETCDCTL_VERSION-linux-amd64.tar.gz -o /tmp/etcd-$ETCDCTL_VERSION-linux-amd64.tar.gz
RUN cd /tmp && gzip -dc etcd-$ETCDCTL_VERSION-linux-amd64.tar.gz | tar -xof -
RUN cp -f /tmp/etcd-$ETCDCTL_VERSION-linux-amd64/etcdctl /usr/local/bin
RUN rm -rf /tmp/etcd-$ETCDCTL_VERSION-linux-amd64.tar.gz
RUN curl -L https://github.com/coreos/etcd/releases/download/$ETCDCTL_VERSION/etcd-$ETCDCTL_VERSION-linux-amd64.tar.gz -o /tmp/etcd-$ETCDCTL_VERSION-linux-amd64.tar.gz && \
cd /tmp && gzip -dc etcd-$ETCDCTL_VERSION-linux-amd64.tar.gz | tar -xof - && \
cp -f /tmp/etcd-$ETCDCTL_VERSION-linux-amd64/etcdctl /usr/local/bin && \
rm -rf /tmp/etcd-$ETCDCTL_VERSION-linux-amd64.tar.gz

# Supervisor and App dependencies
RUN pip install supervisor==3.1.2
Expand All @@ -35,8 +41,8 @@ RUN pip install -r /opt/requirements.txt
#Supervisor Config
RUN mkdir -p /var/log/supervisor
ADD bin/supervisord-wrapper.sh /usr/sbin/supervisord-wrapper.sh
RUN chmod +x /usr/sbin/supervisord-wrapper.sh
RUN ln -sf /etc/supervisor/supervisord.conf /etc/supervisord.conf
RUN chmod +x /usr/sbin/supervisord-wrapper.sh && \
ln -sf /etc/supervisor/supervisord.conf /etc/supervisord.conf

#Confd Defaults
ADD bin/confd-wrapper.sh /usr/sbin/confd-wrapper.sh
Expand Down

0 comments on commit 8971241

Please sign in to comment.