This repository has been archived by the owner on Jun 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
83 lines (69 loc) · 2.85 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
FROM ubuntu:16.04
MAINTAINER "René Moser" <mail@renemoser.net>
RUN echo 'mysql-server mysql-server/root_password password root' | debconf-set-selections; \
echo 'mysql-server mysql-server/root_password_again password root' | debconf-set-selections;
RUN apt-get -y update && apt-get dist-upgrade -y && apt-get install -y \
genisoimage \
libffi-dev \
libssl-dev \
sudo \
ipmitool \
maven \
netcat \
openjdk-8-jdk \
python-dev \
python-setuptools \
python-pip \
python-mysql.connector \
supervisor \
wget \
nginx \
jq \
mysql-server \
openssh-client \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/*;
# TODO: check if and why this is needed
RUN mkdir -p /root/.ssh \
&& chmod 0700 /root/.ssh \
&& ssh-keygen -t rsa -N "" -f id_rsa.cloud
RUN mkdir -p /var/run/mysqld; \
chown mysql /var/run/mysqld; \
echo '''sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"''' >> /etc/mysql/mysql.conf.d/mysqld.cnf
RUN (/usr/bin/mysqld_safe &); sleep 5; mysqladmin -u root -proot password ''
RUN wget https://github.com/apache/cloudstack/archive/4.11.0.0.tar.gz -O /opt/cloudstack.tar.gz; \
mkdir -p /opt/cloudstack; \
tar xvzf /opt/cloudstack.tar.gz -C /opt/cloudstack --strip-components=1
WORKDIR /opt/cloudstack
RUN mvn -Pdeveloper -Dsimulator -DskipTests clean install
RUN mvn -Pdeveloper -Dsimulator dependency:go-offline
RUN mvn -pl client jetty:run -Dsimulator -Djetty.skip -Dorg.eclipse.jetty.annotations.maxWait=120
RUN (/usr/bin/mysqld_safe &); \
sleep 5; \
mvn -Pdeveloper -pl developer -Ddeploydb; \
mvn -Pdeveloper -pl developer -Ddeploydb-simulator; \
MARVIN_FILE=$(find /opt/cloudstack/tools/marvin/dist/ -name "Marvin*.tar.gz"); \
pip install $MARVIN_FILE;
COPY zones.cfg /opt/zones.cfg
COPY nginx_default.conf /etc/nginx/sites-available/default
RUN pip install cs
COPY run.sh /opt/run.sh
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
EXPOSE 8888 8080 8096
CMD ["/usr/bin/supervisord"]