Explorar el Código

przejscie na nowsze wersje gitea oraz naprawienie procesu upgradeu mariadb

master
Lukasz Jarosz hace 5 años
padre
commit
39b599f843
Se han modificado 2 ficheros con 25 adiciones y 2 borrados
  1. 2
    2
      Dockerfile
  2. 23
    0
      files/etc/s6/mariadb/setup

+ 2
- 2
Dockerfile Ver fichero

@@ -1,9 +1,9 @@
1
-FROM gitea/gitea:latest
1
+FROM gitea/gitea:1.8
2 2
 
3 3
 LABEL maintainer="Lukasz Jarosz <lukasz@jarosz.pl>"
4 4
 
5 5
 COPY files /
6 6
 
7 7
 RUN apk update && \
8
-    apk add --no-cache mariadb mariadb-client nginx pwgen su-exec python3 openssl && \
8
+    apk add --no-cache mariadb mariadb-server-utils  mariadb-client nginx pwgen su-exec python3 openssl && \
9 9
     pip3 install acme-tiny

+ 23
- 0
files/etc/s6/mariadb/setup Ver fichero

@@ -6,6 +6,11 @@ if [ ! -d /run/mysqld ]; then
6 6
 fi
7 7
 chown mysql:mysql /run/mysqld
8 8
 
9
+if [ /etc/my.cnf.d/mariadb-server.cnf ]; then
10
+  echo "Deleting dumb configuration file in newer mariadb alpine package"
11
+  rm /etc/my.cnf.d/mariadb-server.cnf
12
+fi
13
+
9 14
 if [ ! -d $DATADIR ]; then
10 15
   echo "initializing db because $DATADIR is missing"
11 16
 
@@ -38,4 +43,22 @@ if [ ! -d $DATADIR ]; then
38 43
   fi
39 44
 
40 45
   rm /tmp/dbinit.sql
46
+fi
47
+
48
+su-exec mysql:mysql mysqld --bind-address=127.0.0.1 --datadir=$DATADIR &
49
+pid="$!"
50
+
51
+for i in {30..0}; do
52
+  if echo 'SELECT 1' | mysql &> /dev/null; then
53
+    break
54
+  fi
55
+  echo 'MySQL init process in progress...'
56
+  sleep 5
57
+done
58
+
59
+mysql_upgrade
60
+
61
+if ! kill -s TERM "$pid" || ! wait "$pid"; then
62
+  echo >&2 'MySQL upgrade process failed.'
63
+  exit 1
41 64
 fi

Loading…
Cancelar
Guardar