Skip to content

Commit dd39249

Browse files
committed
Add CentOS 8
1 parent 22016c6 commit dd39249

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

docker/centos8/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM centos:8
2+
3+
RUN yum -y install glibc-locale-source glibc-langpack-en
4+
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
5+
6+
RUN yum -y install \
7+
php-cli php-xml \
8+
mariadb-server mariadb php-mysqlnd php-json \
9+
#postgresql-server postgresql php-pgsql \
10+
sqlite php-sqlite3 \
11+
git wget
12+
13+
# install run script
14+
ADD run.sh /usr/sbin/docker-run
15+
CMD docker-run

docker/centos8/run.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
echo "================================================"
3+
echo " CentOS 8 (PHP 7.2)"
4+
echo "================================================"
5+
echo -n "[1/4] Starting MariaDB 10.3 ..... "
6+
# initialize mysql
7+
mysql_install_db > /dev/null
8+
chown -R mysql:mysql /var/lib/mysql
9+
# run mysql server
10+
nohup /usr/libexec/mysqld -u mysql > /root/mysql.log 2>&1 &
11+
# wait for mysql to become available
12+
while ! mysqladmin ping -hlocalhost >/dev/null 2>&1; do
13+
sleep 1
14+
done
15+
# create database and user on mysql
16+
mysql -u root >/dev/null << 'EOF'
17+
CREATE DATABASE `php-crud-api` CHARACTER SET utf8 COLLATE utf8_general_ci;
18+
CREATE USER 'php-crud-api'@'localhost' IDENTIFIED BY 'php-crud-api';
19+
GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost' WITH GRANT OPTION;
20+
FLUSH PRIVILEGES;
21+
EOF
22+
echo "done"
23+
24+
echo -n "[2/4] Starting PostgreSQL 10.6 .. "
25+
# # initialize postgresql
26+
# su - -c "/usr/bin/initdb --auth-local peer --auth-host password -D /var/lib/pgsql/data" postgres > /dev/null
27+
# # run postgres server
28+
# nohup su - -c "/usr/bin/postgres -D /var/lib/pgsql/data" postgres > /root/postgres.log 2>&1 &
29+
# # wait for postgres to become available
30+
# until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do
31+
# sleep 1;
32+
# done
33+
# # create database and user on postgres
34+
# su - -c "psql -U postgres >/dev/null" postgres << 'EOF'
35+
# CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
36+
# CREATE DATABASE "php-crud-api";
37+
# GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api";
38+
# \c "php-crud-api";
39+
# CREATE EXTENSION IF NOT EXISTS postgis;
40+
# \q
41+
# EOF
42+
# echo "done"
43+
echo "skipped"
44+
45+
echo -n "[3/4] Starting SQLServer 2017 ... "
46+
echo "skipped"
47+
48+
echo -n "[4/4] Cloning PHP-CRUD-API v2 ... "
49+
# install software
50+
if [ -d /php-crud-api ]; then
51+
echo "skipped"
52+
else
53+
git clone --quiet https://github.com/mevdschee/php-crud-api.git
54+
echo "done"
55+
fi
56+
57+
echo "------------------------------------------------"
58+
59+
# run the tests
60+
cd php-crud-api
61+
php test.php

0 commit comments

Comments
 (0)