Add Dockerfiles for Mesos

Change-Id: Iaf317817eccaa72f2a86b1058a0179afd3427859
Partially-Implements: blueprint mesos
changes/31/261331/50
Michal Rostecki 7 years ago
parent c531338fef
commit 679014a052
  1. 24
      docker/chronos/Dockerfile.j2
  2. 50
      docker/marathon/Dockerfile.j2
  3. 9
      docker/marathon/java8-runtime-headless
  4. 2
      docker/marathon/openjdk.list
  5. 16
      docker/mesos/mesos-base/Dockerfile.j2
  6. 10
      docker/mesos/mesos-master/Dockerfile.j2
  7. 37
      docker/mesos/mesos-slave/Dockerfile.j2
  8. 2
      docker/mesos/mesos-slave/docker.list
  9. 6
      docker/mesos/mesos-slave/docker.repo
  10. 17
      docker/mesosphere/mesosphere-base/Dockerfile.j2
  11. 2
      docker/mesosphere/mesosphere-base/mesosphere.list
  12. 31
      docker/zookeeper/Dockerfile.j2
  13. 6
      docker/zookeeper/extend_start.sh
  14. 1
      docker/zookeeper/zookeeper_sudoers
  15. 8
      kolla/common/config.py

@ -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

@ -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

@ -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

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

@ -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 %}

@ -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

@ -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.

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

@ -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

@ -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 %}

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

@ -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

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

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

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

Loading…
Cancel
Save