Add CentOS 8

This commit is contained in:
Maurits van der Schee 2020-04-13 16:46:18 +02:00
commit dd39249dab
2 changed files with 76 additions and 0 deletions

15
docker/centos8/Dockerfile Normal file
View file

@ -0,0 +1,15 @@
FROM centos:8
RUN yum -y install glibc-locale-source glibc-langpack-en
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
RUN yum -y install \
php-cli php-xml \
mariadb-server mariadb php-mysqlnd php-json \
#postgresql-server postgresql php-pgsql \
sqlite php-sqlite3 \
git wget
# install run script
ADD run.sh /usr/sbin/docker-run
CMD docker-run

61
docker/centos8/run.sh Executable file
View file

@ -0,0 +1,61 @@
#!/bin/bash
echo "================================================"
echo " CentOS 8 (PHP 7.2)"
echo "================================================"
echo -n "[1/4] Starting MariaDB 10.3 ..... "
# initialize mysql
mysql_install_db > /dev/null
chown -R mysql:mysql /var/lib/mysql
# run mysql server
nohup /usr/libexec/mysqld -u mysql > /root/mysql.log 2>&1 &
# wait for mysql to become available
while ! mysqladmin ping -hlocalhost >/dev/null 2>&1; do
sleep 1
done
# create database and user on mysql
mysql -u root >/dev/null << 'EOF'
CREATE DATABASE `php-crud-api` CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'php-crud-api'@'localhost' IDENTIFIED BY 'php-crud-api';
GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EOF
echo "done"
echo -n "[2/4] Starting PostgreSQL 10.6 .. "
# # initialize postgresql
# su - -c "/usr/bin/initdb --auth-local peer --auth-host password -D /var/lib/pgsql/data" postgres > /dev/null
# # run postgres server
# nohup su - -c "/usr/bin/postgres -D /var/lib/pgsql/data" postgres > /root/postgres.log 2>&1 &
# # wait for postgres to become available
# until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do
# sleep 1;
# done
# # create database and user on postgres
# su - -c "psql -U postgres >/dev/null" postgres << 'EOF'
# CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
# CREATE DATABASE "php-crud-api";
# GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api";
# \c "php-crud-api";
# CREATE EXTENSION IF NOT EXISTS postgis;
# \q
# EOF
# echo "done"
echo "skipped"
echo -n "[3/4] Starting SQLServer 2017 ... "
echo "skipped"
echo -n "[4/4] Cloning PHP-CRUD-API v2 ... "
# install software
if [ -d /php-crud-api ]; then
echo "skipped"
else
git clone --quiet https://github.com/mevdschee/php-crud-api.git
echo "done"
fi
echo "------------------------------------------------"
# run the tests
cd php-crud-api
php test.php