Skip to content

Commit 02a9f5a

Browse files
committed
Support versioned PolarDB install path in Sealos image
1 parent 117ff09 commit 02a9f5a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docker/sealos/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ COPY polardb-entrypoint.sh /usr/local/bin/polardb-entrypoint.sh
55

66
RUN rpm -ivh /tmp/PolarDB-*.rpm \
77
&& (id postgres >/dev/null 2>&1 || useradd -m postgres) \
8+
&& POLARDB_INSTALL_DIR="$(find /u01 -maxdepth 3 -type f -path '*/bin/postgres' -print -quit | sed 's#/bin/postgres##')" \
9+
&& test -n "$POLARDB_INSTALL_DIR" \
10+
&& if [ "$POLARDB_INSTALL_DIR" != "/u01/polardb_pg" ]; then ln -sfn "$POLARDB_INSTALL_DIR" /u01/polardb_pg; fi \
811
&& mkdir -p /var/lib/polardb \
9-
&& chown -R postgres:postgres /var/lib/polardb /u01/polardb_pg \
12+
&& chown -R postgres:postgres /var/lib/polardb "$POLARDB_INSTALL_DIR" \
13+
&& chown -h postgres:postgres /u01/polardb_pg \
1014
&& chmod +x /usr/local/bin/polardb-entrypoint.sh \
1115
&& rm -f /tmp/PolarDB-*.rpm
1216

0 commit comments

Comments
 (0)