Add Dockerfiles for Mesos

Change-Id: Iaf317817eccaa72f2a86b1058a0179afd3427859
Partially-Implements: blueprint mesos
This commit is contained in:
Michal Rostecki 2015-12-18 06:57:17 +01:00
parent c531338fef
commit 679014a052
15 changed files with 219 additions and 2 deletions

View File

@ -0,0 +1,24 @@
FROM {{ namespace }}/{{ image_prefix }}mesos-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y \
chronos \
&& yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get install -y --no-install-recommends \
chronos \
&& apt-get clean
{% endif %}
RUN useradd --user-group chronos
CMD chronos run_jar --http_port $CHRONOS_HTTP_PORT --master $CHRONOS_MASTER --zk_hosts $CHRONOS_ZK_HOSTS
{{ include_footer }}
USER chronos

View File

@ -0,0 +1,50 @@
FROM {{ namespace }}/{{ image_prefix }}mesos-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y \
marathon \
&& yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
COPY openjdk.list /etc/apt/sources.list.d/openjdk.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv DA1A4A13543B466853BAF164EB9B1D8886F44E2A \
&& apt-get update
# NOTE(nihilifer): Marathon package for Ubuntu depends on Oracle Java and
# there is no official way to use OpenJDK. There is no way to accept the
# license in kolla. That's why the fake package is created here and OpenJDK
# is used anyway.
# We only have to do this with Ubuntu - CentOS packages don't depend strictly
# on Oracle JDK and installing them by yum just installs OpenJDK as a
# dependency.
RUN apt-get install -y --no-install-recommends \
equivs \
gcc \
&& apt-get clean
COPY java8-runtime-headless /
RUN equivs-build java8-runtime-headless \
&& dpkg -i java8-runtime-headless_42_all.deb \
&& rm java8-runtime-headless java8-runtime-headless_42_all.deb
RUN apt-get install -y --no-install-recommends \
marathon \
openjdk-8-jre-headless \
&& apt-get clean
{% endif %}
RUN useradd --user-group marathon \
&& chmod 755 /usr/bin/marathon
CMD ["marathon", "--no-logger"]
{{ include_footer }}
USER marathon

View File

@ -0,0 +1,9 @@
Section: misc
Priority: optional
Standards-Version: 3.9.2
Package: java8-runtime-headless
Version: 1:42
Maintainer: Kolla Project (https://launchpad.net/kolla)
Architecture: all
Description: fake Oracle Java package to block a non-free dependency

View File

@ -0,0 +1,2 @@
# OpenJDK 8 repo
deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty main

View File

@ -0,0 +1,16 @@
FROM {{ namespace }}/{{ image_prefix }}mesosphere-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y \
mesos \
&& yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get install -y --no-install-recommends \
mesos \
&& apt-get clean
{% endif %}

View File

@ -0,0 +1,10 @@
FROM {{ namespace }}/{{ image_prefix }}mesos-base:{{ tag }}
MAINTAINER {{ maintainer }}
RUN useradd --user-group mesos
CMD ["mesos-master"]
{{ include_footer }}
USER mesos

View File

@ -0,0 +1,37 @@
FROM {{ namespace }}/{{ image_prefix }}mesos-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
COPY docker.repo /etc/yum.repos.d/docker.repo
RUN rpm --import https://yum.dockerproject.org/gpg
RUN yum install -y \
docker-engine \
&& yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
COPY docker.list /etc/apt/sources.list.d/docker.list
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv 58118E89F3A912897C070ADBF76221572C52609D \
&& apt-get update
RUN apt-get install -y --no-install-recommends \
docker-engine \
&& apt-get clean
{% endif %}
ENV MESOS_CONTAINERIZERS docker
# Increase executor's timeout for pulling a Docker image to the slave
# https://mesosphere.github.io/marathon/docs/native-docker.html
ENV MESOS_EXECUTOR_REGISTRATION_TIMEOUT 5mins
CMD ["mesos-slave"]
{{ include_footer }}
# This container should run as a root, because it's talking to the Docker
# socket directly.

View File

@ -0,0 +1,2 @@
# Docker repo
deb http://apt.dockerproject.org/repo ubuntu-trusty main

View File

@ -0,0 +1,6 @@
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg

View File

@ -0,0 +1,17 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN rpm --import http://repos.mesosphere.io/el/RPM-GPG-KEY-mesosphere
RUN rpm -Uvh http://repos.mesosphere.com/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
{% elif base_distro in ['ubuntu', 'debian'] %}
COPY mesosphere.list /etc/apt/sources.list.d/mesosphere.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv 81026D0004C44CF7EF55ADF8DF7D54CBE56151BF \
&& apt-get update
{% endif %}

View File

@ -0,0 +1,2 @@
# Mesosphere repo
deb http://repos.mesosphere.com/ubuntu trusty main

View File

@ -0,0 +1,31 @@
FROM {{ namespace }}/{{ image_prefix }}mesosphere-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y \
mesosphere-zookeeper \
&& yum clean all
RUN useradd --user-group zookeeper
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get install -y --no-install-recommends \
zookeeper \
&& apt-get clean
{% endif %}
COPY zookeeper_sudoers /etc/sudoers.d/zookeeper_sudoers
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start \
&& chmod 750 /etc/sudoers.d \
&& chmod 440 /etc/sudoers.d/zookeeper_sudoers \
&& usermod -a -G kolla zookeeper
ENV ZOOCFGDIR=/etc/zookeeper/conf
{{ include_footer }}
USER zookeeper

View File

@ -0,0 +1,6 @@
#!/bin/bash
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
sudo chown zookeeper: /var/lib/zookeeper
exit 0
fi

View File

@ -0,0 +1 @@
%kolla ALL=(root) NOPASSWD: /bin/chown zookeeper\: /var/lib/zookeeper, /usr/bin/chown zookeeper\: /var/lib/zookeeper

View File

@ -36,7 +36,7 @@ _PROFILE_OPTS = [
help='Main images'), help='Main images'),
cfg.ListOpt('aux', cfg.ListOpt('aux',
default=['aodh', 'designate', 'gnocchi', 'ironic', default=['aodh', 'designate', 'gnocchi', 'ironic',
'magnum', 'mistral', 'trove,' 'zaqar'], 'magnum', 'mistral', 'trove,' 'zaqar', 'zookeeper'],
help='Aux Images'), help='Aux Images'),
cfg.ListOpt('default', cfg.ListOpt('default',
default=['data', 'kolla-ansible', 'glance', 'haproxy', default=['data', 'kolla-ansible', 'glance', 'haproxy',
@ -50,7 +50,11 @@ _PROFILE_OPTS = [
'keystone', 'kolla-ansible', 'mariadb', 'keystone', 'kolla-ansible', 'mariadb',
'memcached', 'neutron', 'nova', 'openvswitch', 'memcached', 'neutron', 'nova', 'openvswitch',
'rabbitmq', 'rsyslog'], 'rabbitmq', 'rsyslog'],
help='Gate images') help='Gate images'),
cfg.ListOpt('mesos',
default=['chronos', 'marathon', 'mesos-master', 'mesos-slave',
'zookeeper'],
help='Mesos images')
] ]
_CLI_OPTS = [ _CLI_OPTS = [