Skip to content

Commit 06f602c

Browse files
tools/docker: Upgrade to ubuntu 20.04 , MySQL 8 and python3 (apache#5507)
* tools/docker: Upgrade to ubuntu 20.04 , MySQL 8 and python3 * Update tools/docker/README.md * docker simulator: run 'npm rebuild node-sass' before 'npm install'
1 parent d1f375f commit 06f602c

File tree

3 files changed

+48
-9
lines changed

3 files changed

+48
-9
lines changed

tools/docker/Dockerfile

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
# CloudStack-simulator build
1919

20-
FROM ubuntu:18.04
20+
FROM ubuntu:20.04
2121

2222
MAINTAINER "Apache CloudStack" <dev@cloudstack.apache.org>
2323
LABEL Vendor="Apache.org" License="ApacheV2" Version="4.16.0.0-SNAPSHOT"
@@ -28,24 +28,27 @@ RUN apt-get -y update && apt-get install -y \
2828
genisoimage \
2929
libffi-dev \
3030
libssl-dev \
31+
curl \
32+
gcc-10 \
3133
git \
3234
sudo \
3335
ipmitool \
3436
iproute2 \
3537
maven \
3638
openjdk-11-jdk \
37-
python-dev \
38-
python-setuptools \
39-
python-pip \
40-
python-mysql.connector \
39+
python3-dev \
40+
python-is-python3 \
41+
python3-setuptools \
42+
python3-pip \
43+
python3-mysql.connector \
4144
supervisor
4245

4346
RUN apt-get install -qqy mysql-server && \
4447
apt-get clean all && \
4548
mkdir /var/run/mysqld; \
4649
chown mysql /var/run/mysqld
4750

48-
RUN 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
51+
RUN echo '''sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"''' >> /etc/mysql/mysql.conf.d/mysqld.cnf
4952

5053
COPY tools/docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
5154
COPY . ./root
@@ -60,10 +63,16 @@ RUN find /var/lib/mysql -type f -exec touch {} \; && \
6063
mvn -Pdeveloper -pl developer -Ddeploydb; \
6164
mvn -Pdeveloper -pl developer -Ddeploydb-simulator; \
6265
MARVIN_FILE=`find /root/tools/marvin/dist/ -name "Marvin*.tar.gz"`; \
63-
pip install $MARVIN_FILE
66+
rm -rf /usr/bin/x86_64-linux-gnu-gcc && \
67+
ln -s /usr/bin/gcc-10 /usr/bin/x86_64-linux-gnu-gcc; \
68+
pip3 install $MARVIN_FILE
69+
70+
RUN curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -; \
71+
apt-get install -y nodejs; \
72+
cd ui && npm rebuild node-sass && npm install
6473

6574
VOLUME /var/lib/mysql
6675

67-
EXPOSE 8080 8096
76+
EXPOSE 8080 8096 5050
6877

6978
CMD ["/usr/bin/supervisord"]

tools/docker/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,30 @@ CloudStack Simulator is an all in one CloudStack Build including the simulator t
1212

1313
```
1414
docker pull cloudstack/simulator
15-
docker run --name simulator -p 8080:8080 -d cloudstack/simulator
15+
docker run --name simulator -p 8080:5050 -d cloudstack/simulator
16+
```
17+
18+
Access CloudStack UI
19+
```
20+
Open your browser at http://localhost:8080/
21+
Default login is admin:password
22+
```
23+
24+
Deploy a datacenter:
25+
```
26+
# Advanced zone
27+
docker exec -it simulator python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/advanced.cfg
28+
29+
# Advanced zone with security groups
30+
docker exec -it simulator python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/advancedsg.cfg
31+
32+
# Basic zone
33+
docker exec -it simulator python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/basic.cfg
34+
```
35+
36+
Log into the simulator:
37+
```
38+
docker exec -it simulator bash
1639
```
1740

1841
### CloudStack Management-server

tools/docker/supervisord.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@ directory=/root
1313
stdout_logfile=/dev/stdout
1414
stdout_logfile_maxbytes=0
1515
user=root
16+
17+
[program:cloudstack-ui]
18+
command=/bin/bash -c "npm run serve"
19+
directory=/root/ui
20+
stdout_logfile=/dev/stdout
21+
stdout_logfile_maxbytes=0
22+
user=root

0 commit comments

Comments
 (0)