Use base-tools as the base for alarm-manager

In I7b2b98f379c49bdbf23177a038bdca9433d1c6e5 reviews
suggested to use "base" rather than "base-tools" as the base
image. This commit reverts that. Using "base" forces to add
dependencies such as "dumb-init", which should really not be
the responsibility of authors of non-base images.

This commit also changes the way we specify versions of
Python dependencies in requirements.txt. Fixing versions
using `==` allows for more repeatable builds, but it also
means that we will quickly rely on old versions and will not
be able to guarantee that our code works with the latest
versions of our dependencies. Using `>=` is also consistent
with what we currently use in base-tools/requirements.txt.
requirements.txt was updated using openstack_requirement's
update-requirements tool.

Change-Id: I60d0d8e761da717e2f73485bae53f1e11e3aebba
This commit is contained in:
Éric Lemoine 2016-09-22 08:32:20 +00:00
parent 4b0617cd24
commit 6941106f40
2 changed files with 9 additions and 16 deletions

View File

@ -1,4 +1,4 @@
FROM {{ namespace }}/base:{{ tag }}
FROM {{ namespace }}/base-tools:{{ tag }}
MAINTAINER {{ maintainer }}
# Install alarm-manager and dependencies
@ -6,15 +6,11 @@ COPY alarm-manager.py /opt/ccp/bin/
COPY requirements.txt /tmp/requirements.txt
COPY config-files /etc/alarm-manager/
RUN apt-get install -y --no-install-recommends patch gcc python-dev \
&& apt-get clean \
&& pip install --no-cache-dir -r /tmp/requirements.txt \
RUN pip install --no-cache-dir -r /tmp/requirements.txt \
&& useradd --user-group alarm-manager \
&& usermod -a -G microservices alarm-manager \
&& chown -R alarm-manager: /etc/alarm-manager \
&& chmod 755 /opt/ccp/bin/alarm-manager.py \
&& rm -f /tmp/requirements.txt \
&& apt-get -y purge patch gcc python-dev \
&& apt-get -y autoremove
&& rm -f /tmp/requirements.txt
USER alarm-manager

View File

@ -1,9 +1,6 @@
pyinotify==0.9.6
# Mandatory utilities for use in CCP
dumb-init # init system for containers
python-etcd
netifaces
six==1.10.0 # MIT
# Common utilities
PyYAML==3.12 # BSD License (3 clause)
Jinja2==2.8 # MIT
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pyinotify>=0.9.6;sys_platform!='win32' and sys_platform!='darwin' and sys_platform!='sunos5' # MIT
PyYAML>=3.1.0 # MIT
Jinja2>=2.8 # BSD License (3 clause)