Fail on any yum install error during docker build

Yum returns 0 on partial failures, so the only way around
is to run separate `yum install` commands. This ensures
that the build fails early on, instead of at a later point,
wasting a deployer's time.

Change-Id: I4a85cd328c0d31c193c85f02c042ee5405666e5f
Partial-Bug: #1461052
This commit is contained in:
Matthew Mosesohn 2015-08-05 16:13:45 +03:00
parent 7a374fbd1f
commit ff44a40c29
4 changed files with 5 additions and 6 deletions

View File

@ -5,7 +5,7 @@
FROM fuel/centos
MAINTAINER Matthew Mosesohn mmosesohn@mirantis.com
RUN rm -rf /etc/yum.repos.d/*; echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=http://$(route -n | awk '/^0.0.0.0/ { print $2 }'):_PORT_/os/x86_64/\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean expire-cache ; yum update -y; yum --quiet install -y ruby21-nailgun-mcagents sysstat
RUN rm -rf /etc/yum.repos.d/*; echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=http://$(route -n | awk '/^0.0.0.0/ { print $2 }'):_PORT_/os/x86_64/\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean expire-cache ; yum update -y; echo ruby21-nailgun-mcagents sysstat | xargs -n1 yum install -y --quiet
ADD etc /etc
ADD start.sh /usr/local/bin/start.sh

View File

@ -5,8 +5,7 @@
FROM fuel/centos
MAINTAINER Matthew Mosesohn mmosesohn@mirantis.com
RUN rm -rf /etc/yum.repos.d/*;echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=http://$(route -n | awk '/^0.0.0.0/ { print $2 }'):_PORT_/os/x86_64/\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean expire-cache; yum update -y; yum --quiet install -y httpd cobbler dnsmasq xinetd tftp-server; ln -s /etc/dnsmasq.conf /etc/cobbler.dnsmasq.conf
RUN rm -rf /etc/yum.repos.d/*;echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=http://$(route -n | awk '/^0.0.0.0/ { print $2 }'):_PORT_/os/x86_64/\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean expire-cache; yum update -y; ln -s /etc/dnsmasq.conf /etc/cobbler.dnsmasq.conf; echo httpd cobbler dnsmasq xinetd tftp-server | xargs -n1 yum install -y --quiet
ADD etc /etc
ADD start.sh /usr/local/bin/start.sh

View File

@ -4,7 +4,7 @@ MAINTAINER Aleksandr Didenko adidenko@mirantis.com
WORKDIR /root
RUN rm -rf /etc/yum.repos.d/*; echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=http://$(route -n | awk '/^0.0.0.0/ { print $2 }'):_PORT_/os/x86_64/\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean expire-cache; yum update -y; yum --quiet install -y sudo ruby21-mcollective
RUN rm -rf /etc/yum.repos.d/*; echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=http://$(route -n | awk '/^0.0.0.0/ { print $2 }'):_PORT_/os/x86_64/\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean expire-cache; yum update -y; echo sudo ruby21-mcollective shotgun fuel-agent fuel-provisioning-scripts | xargs -n1 yum install -y --quiet
ADD etc /etc
ADD start.sh /usr/local/bin/start.sh
@ -13,7 +13,7 @@ ADD start.sh /usr/local/bin/start.sh
RUN mkdir -p /var/lib/hiera /var/lib/fuel/ibp && touch /etc/puppet/hiera.yaml /var/lib/hiera/common.yaml; /usr/bin/puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/mcollective/examples/mcollective-server-only.pp; [[ $? == 0 || $? == 2 ]]
#FIXME(mattymo): Workaround to make diagnostic snapshots work
RUN yum install -y shotgun fuel-agent fuel-provisioning-scripts; mkdir -p /opt/nailgun/bin /var/www/nailgun/dump; ln -s /usr/bin/nailgun_dump /opt/nailgun/bin/nailgun_dump
RUN mkdir -p /opt/nailgun/bin /var/www/nailgun/dump; ln -s /usr/bin/nailgun_dump /opt/nailgun/bin/nailgun_dump
# let's disable some services and commands since we don't need them in our container
RUN echo -e '#!/bin/bash\n#chkconfig: 345 20 80\nexit 0' > /etc/init.d/mcollective

View File

@ -5,7 +5,7 @@
FROM fuel/centos
MAINTAINER Matthew Mosesohn mmosesohn@mirantis.com
RUN rm -rf /etc/yum.repos.d/*;echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=http://$(route -n | awk '/^0.0.0.0/ { print $2 }'):_PORT_/os/x86_64/\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo;yum clean expire-cache;yum update -y; yum --quiet install -y python-fuelclient supervisor postgresql-libs
RUN rm -rf /etc/yum.repos.d/*;echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=http://$(route -n | awk '/^0.0.0.0/ { print $2 }'):_PORT_/os/x86_64/\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo;yum clean expire-cache;yum update -y; echo python-fuelclient supervisor postgresql-libs | xargs -n1 yum install -y --quiet
ADD etc /etc
ADD start.sh /usr/local/bin/start.sh