Selaa lähdekoodia

Improve CentOS 8 docker

Maurits van der Schee 4 vuotta sitten
vanhempi
commit
e7d3de8d2e
2 muutettua tiedostoa jossa 14 lisäystä ja 6 poistoa
  1. 10
    2
      docker/centos8/Dockerfile
  2. 4
    4
      docker/centos8/run.sh

+ 10
- 2
docker/centos8/Dockerfile Näytä tiedosto

3
 # add this to avoid locale warnings
3
 # add this to avoid locale warnings
4
 RUN yum -y install glibc-locale-source glibc-langpack-en
4
 RUN yum -y install glibc-locale-source glibc-langpack-en
5
 RUN localedef -i en_US -f UTF-8 en_US.UTF-8
5
 RUN localedef -i en_US -f UTF-8 en_US.UTF-8
6
+# add utils for repos
7
+RUN dnf -y install wget dnf-utils
8
+# enable remi repo for php
9
+RUN dnf -y install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
10
+RUN wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup && bash mariadb_repo_setup
6
 # enable the postgresql repo
11
 # enable the postgresql repo
7
 RUN yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
12
 RUN yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
8
 # enable epel and powertools repos
13
 # enable epel and powertools repos
9
 RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
14
 RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
10
 RUN dnf -y install 'dnf-command(config-manager)' && dnf -y config-manager --set-enabled PowerTools
15
 RUN dnf -y install 'dnf-command(config-manager)' && dnf -y config-manager --set-enabled PowerTools
11
-# disable postgresql appstream repo
16
+# set php to remi 7.4
17
+RUN dnf -y module reset php && dnf -y module enable php:remi-7.4
18
+# disable mariadb and postgresql appstream repo
19
+RUN dnf -y module disable mariadb
12
 RUN dnf -y module disable postgresql
20
 RUN dnf -y module disable postgresql
13
 
21
 
14
 RUN yum -y install \
22
 RUN yum -y install \
15
 php-cli php-xml \
23
 php-cli php-xml \
16
-mariadb-server mariadb php-mysqlnd php-json \
24
+MariaDB-server MariaDB-client php-mysqlnd php-json \
17
 postgresql12 postgresql12-server php-pgsql postgis30_12 \
25
 postgresql12 postgresql12-server php-pgsql postgis30_12 \
18
 sqlite php-sqlite3 \
26
 sqlite php-sqlite3 \
19
 git wget
27
 git wget

+ 4
- 4
docker/centos8/run.sh Näytä tiedosto

1
 #!/bin/bash
1
 #!/bin/bash
2
 echo "================================================"
2
 echo "================================================"
3
-echo " CentOS 8 (PHP 7.2)"
3
+echo " CentOS 8 (PHP 7.4)"
4
 echo "================================================"
4
 echo "================================================"
5
-echo -n "[1/4] Starting MariaDB 10.3 ..... "
5
+echo -n "[1/4] Starting MariaDB 10.4 ..... "
6
 # initialize mysql
6
 # initialize mysql
7
 mysql_install_db > /dev/null
7
 mysql_install_db > /dev/null
8
 chown -R mysql:mysql /var/lib/mysql
8
 chown -R mysql:mysql /var/lib/mysql
9
 # run mysql server
9
 # run mysql server
10
-nohup /usr/libexec/mysqld -u mysql > /root/mysql.log 2>&1 &
10
+nohup /usr/sbin/mysqld -u mysql > /root/mysql.log 2>&1 &
11
 # wait for mysql to become available
11
 # wait for mysql to become available
12
 while ! mysqladmin ping -hlocalhost >/dev/null 2>&1; do
12
 while ! mysqladmin ping -hlocalhost >/dev/null 2>&1; do
13
     sleep 1
13
     sleep 1
14
 done
14
 done
15
 # create database and user on mysql
15
 # create database and user on mysql
16
 mysql -u root >/dev/null << 'EOF'
16
 mysql -u root >/dev/null << 'EOF'
17
-CREATE DATABASE `php-crud-api` CHARACTER SET utf8 COLLATE utf8_general_ci;
17
+CREATE DATABASE `php-crud-api` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
18
 CREATE USER 'php-crud-api'@'localhost' IDENTIFIED BY 'php-crud-api';
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;
19
 GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost' WITH GRANT OPTION;
20
 FLUSH PRIVILEGES;
20
 FLUSH PRIVILEGES;

Loading…
Peruuta
Tallenna