|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | +# |
| 18 | +# CloudStack-simulator build |
| 19 | + |
| 20 | +FROM ubuntu:22.04 |
| 21 | + |
| 22 | +LABEL Vendor="Apache.org" License="ApacheV2" Version="4.23.0.0-SNAPSHOT" Author="Apache CloudStack <dev@cloudstack.apache.org>" |
| 23 | + |
| 24 | +ARG DEBIAN_FRONTEND=noninteractive |
| 25 | + |
| 26 | +RUN apt-get -y update && apt-get install -y \ |
| 27 | + genisoimage \ |
| 28 | + libffi-dev \ |
| 29 | + libssl-dev \ |
| 30 | + curl \ |
| 31 | + gcc-10 \ |
| 32 | + git \ |
| 33 | + sudo \ |
| 34 | + ipmitool \ |
| 35 | + iproute2 \ |
| 36 | + maven \ |
| 37 | + openjdk-11-jdk \ |
| 38 | + python3-dev \ |
| 39 | + python-is-python3 \ |
| 40 | + python3-setuptools \ |
| 41 | + python3-pip \ |
| 42 | + python3-mysql.connector \ |
| 43 | + # Required on s390x as pre-built wheels for bcrypt, cryptography, and cffi are unavailable, necessitating source builds. |
| 44 | + python3-bcrypt \ |
| 45 | + python3-cryptography \ |
| 46 | + python3-cffi \ |
| 47 | + supervisor |
| 48 | + |
| 49 | +RUN apt-get install -qqy mysql-server && \ |
| 50 | + apt-get clean all && \ |
| 51 | + mkdir -p /var/run/mysqld; \ |
| 52 | + chown mysql /var/run/mysqld |
| 53 | + |
| 54 | +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 |
| 55 | + |
| 56 | +COPY tools/docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf |
| 57 | +COPY . ./root |
| 58 | +WORKDIR /root |
| 59 | + |
| 60 | +RUN mvn -Pdeveloper -Dsimulator -DskipTests clean install |
| 61 | + |
| 62 | +RUN find /var/lib/mysql -type f -exec touch {} \; && \ |
| 63 | + (/usr/bin/mysqld_safe &) && \ |
| 64 | + sleep 5; \ |
| 65 | + mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by ''" --connect-expired-password; \ |
| 66 | + mvn -Pdeveloper -pl developer -Ddeploydb; \ |
| 67 | + mvn -Pdeveloper -pl developer -Ddeploydb-simulator; \ |
| 68 | + MARVIN_FILE=`find /root/tools/marvin/dist/ -name "Marvin*.tar.gz"`; \ |
| 69 | + rm -rf /usr/bin/s390x-linux-gnu-gcc && \ |
| 70 | + ln -s /usr/bin/gcc-10 /usr/bin/s390x-linux-gnu-gcc && \ |
| 71 | + pip3 install maturin && \ |
| 72 | + pip3 install $MARVIN_FILE |
| 73 | + |
| 74 | +RUN apt-get install -y nodejs npm build-essential python3 g++ make |
| 75 | + |
| 76 | +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash && \ |
| 77 | + . /root/.nvm/nvm.sh && \ |
| 78 | + nvm install 16 && \ |
| 79 | + nvm use 16 && \ |
| 80 | + NVM_BIN="$(dirname "$(nvm which node)")" && \ |
| 81 | + ln -sf "$NVM_BIN/node" /usr/local/bin/node && \ |
| 82 | + ln -sf "$NVM_BIN/npm" /usr/local/bin/npm && \ |
| 83 | + cd ui && npm rebuild node-sass && npm install |
| 84 | + |
| 85 | + |
| 86 | +VOLUME /var/lib/mysql |
| 87 | + |
| 88 | +EXPOSE 8080 8096 5050 |
| 89 | + |
| 90 | +CMD ["/usr/bin/supervisord"] |
| 91 | + |
0 commit comments