2015-07-16 07:03:24 -07:00
|
|
|
FROM debian:jessie
|
2014-01-17 12:55:30 -08:00
|
|
|
|
|
|
|
# The add is before the RUN to ensure we get the latest version of packages
|
|
|
|
# Docker will cache RUN commands, but because the SHA1 of the dir will be
|
|
|
|
# different it will not cache this layer
|
2014-03-19 16:27:43 -07:00
|
|
|
ADD . /tmp/ironic-python-agent
|
2014-01-17 12:55:30 -08:00
|
|
|
|
2016-01-13 14:13:20 -08:00
|
|
|
# Copy the proxy.sh script which copies the proxy settings from the host
|
|
|
|
# environment (if they are set). This file will be dynamically created by
|
|
|
|
# imagebuild/coreos/docker_build.bash
|
|
|
|
# TODO(jlvilla): Once Docker 1.9 is widely deployed, switch to using the 'ARG'
|
|
|
|
# command which was added in Docker 1.9. Currently Ubuntu 14.04 uses Docker
|
|
|
|
# 1.6. Using the ARG command will be a much cleaner solution.
|
|
|
|
COPY proxy.sh /usr/bin/proxy.sh
|
|
|
|
|
2016-04-18 13:30:35 -07:00
|
|
|
# Ensure we hit a single mirror for builds, since httpredir is flakey
|
|
|
|
RUN sed -i 's/httpredir/http.us/g' /etc/apt/sources.list
|
|
|
|
|
2016-04-13 15:09:31 +03:00
|
|
|
# Add 'backports' for qemu-utils
|
2016-04-18 13:30:35 -07:00
|
|
|
RUN echo 'deb http://http.us.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list
|
2015-08-31 14:27:22 +00:00
|
|
|
|
2014-03-19 16:27:43 -07:00
|
|
|
# Install requirements: Python for ironic-python-agent, others for putting an
|
|
|
|
# image on disk
|
2016-01-13 14:13:20 -08:00
|
|
|
RUN proxy.sh apt-get update && \
|
|
|
|
proxy.sh apt-get -y upgrade && \
|
2018-05-03 08:04:20 -07:00
|
|
|
proxy.sh apt-get install -y --no-install-recommends netbase gdisk \
|
|
|
|
python2.7 python2.7-dev python-pip qemu-utils parted hdparm \
|
|
|
|
util-linux genisoimage git gcc bash coreutils tgt dmidecode \
|
2018-06-13 12:13:20 -07:00
|
|
|
ipmitool psmisc dosfstools bsdmainutils open-iscsi udev \
|
2018-10-16 11:51:43 +01:00
|
|
|
smartmontools iptables lshw && \
|
2016-04-13 15:09:31 +03:00
|
|
|
proxy.sh apt-get --only-upgrade -t jessie-backports install -y qemu-utils
|
2015-08-31 14:27:22 +00:00
|
|
|
|
|
|
|
# Some cleanup
|
2016-01-13 14:13:20 -08:00
|
|
|
RUN proxy.sh apt-get -y autoremove && \
|
|
|
|
proxy.sh apt-get clean
|
2014-01-17 12:55:30 -08:00
|
|
|
|
2015-08-31 14:27:22 +00:00
|
|
|
# Before cleaning mark packages that are required so they are not removed
|
|
|
|
RUN apt-mark manual python-setuptools
|
|
|
|
RUN apt-mark manual python-minimal
|
|
|
|
|
2014-03-19 16:27:43 -07:00
|
|
|
# Install requirements separately, because pip understands a git+https url
|
|
|
|
# while setuptools doesn't
|
2016-01-13 14:13:20 -08:00
|
|
|
RUN proxy.sh pip install --upgrade pip
|
2016-08-22 15:43:39 -04:00
|
|
|
RUN proxy.sh pip install -c /tmp/ironic-python-agent/upper-constraints.txt --no-cache-dir -r /tmp/ironic-python-agent/requirements.txt
|
2014-01-22 17:02:22 -08:00
|
|
|
|
2014-03-17 10:58:39 -07:00
|
|
|
# This will succeed because all the dependencies were installed previously
|
2016-08-22 15:43:39 -04:00
|
|
|
RUN proxy.sh pip install -c /tmp/ironic-python-agent/upper-constraints.txt --no-cache-dir /tmp/ironic-python-agent
|
2015-07-01 18:42:05 +00:00
|
|
|
|
|
|
|
# Remove no longer needed packages
|
2016-01-28 09:49:14 -08:00
|
|
|
# NOTE(jroll) leave git to avoid strange apt issues in downstream Dockerfiles
|
|
|
|
# that may inherit from this one.
|
2016-01-13 14:13:20 -08:00
|
|
|
RUN proxy.sh apt-get -y purge gcc-4.6 gcc python2.7-dev && \
|
|
|
|
proxy.sh apt-get -y autoremove && \
|
|
|
|
proxy.sh apt-get clean
|
2015-08-31 14:27:22 +00:00
|
|
|
RUN rm -rf /tmp/ironic-python-agent
|
|
|
|
RUN rm -rf /var/lib/apt/lists/*
|
2014-01-17 12:55:30 -08:00
|
|
|
|
2014-03-19 16:27:43 -07:00
|
|
|
CMD [ "/usr/local/bin/ironic-python-agent" ]
|