FROM centos:7
RUN curl -L https://pkg.osquery.io/rpm/GPG | tee /etc/pki/rpm-gpg/RPM-GPG-KEY-osquery \
    && yum-config-manager --add-repo https://pkg.osquery.io/rpm/osquery-s3-rpm.repo \
    && yum-config-manager --enable osquery-s3-rpm
RUN yum install wget git vim python-setuptools net-tools unzip osquery gcc python-devel -y
WORKDIR /root
RUN easy_install pip \
    && pip install -U setuptools
RUN git clone --bare https://github.com/hubblestack/hubble repo
ADD https://github.com/hubblestack/hubble/archive/develop.zip /tmp
RUN unzip /tmp/develop.zip \
    && mv hubble-develop hubble \
    && mv repo hubble/.git
WORKDIR /root/hubble
RUN git init \
    && git pull \
    && git reset HEAD
RUN python setup.py install --force

FROM centos:7
RUN curl -L https://pkg.osquery.io/rpm/GPG | tee /etc/pki/rpm-gpg/RPM-GPG-KEY-osquery \
    && yum-config-manager --add-repo https://pkg.osquery.io/rpm/osquery-s3-rpm.repo \
    && yum-config-manager --enable osquery-s3-rpm
RUN yum install wget git vim python-setuptools net-tools unzip osquery gcc python-devel -y
WORKDIR /root
RUN easy_install pip \
    && pip install -U setuptools
ADD https://github.com/hubblestack/hubble/archive/develop.zip /tmp
RUN git clone https://github.com/hubblestack/hubble /root/hubble
WORKDIR /root/hubble
RUN python setup.py install --force

Fix the hubblestack/cent7dev for caching

Originally I was just going to turn off caching for the build altogether
and just do a full clone every time. But that seems a little silly. So
I added back in the ADD command even though we don't use the result. I
figure it's better to download the develop archive than to have to
install osquery and the other deps every time.

I think with these changes I can re-enable caching on the docker hub
build which will save time and resources overall even though we have the
wasted ADD command.
