You've already forked postgres
mirror of
https://github.com/docker-library/postgres.git
synced 2025-07-28 10:42:06 +03:00
Add more minor tweaks to generate-stackbrew-library.sh and update.sh
This commit is contained in:
18
docker-entrypoint.sh
Executable file
18
docker-entrypoint.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ "$1" = 'postgres' ]; then
|
||||
chown -R postgres "$PGDATA"
|
||||
|
||||
if [ -z "$(ls -A "$PGDATA")" ]; then
|
||||
gosu postgres initdb
|
||||
|
||||
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
|
||||
|
||||
{ echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf
|
||||
fi
|
||||
|
||||
exec gosu postgres "$@"
|
||||
fi
|
||||
|
||||
exec "$@"
|
@ -11,12 +11,12 @@ cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
|
||||
|
||||
versions=( */ )
|
||||
versions=( "${versions[@]%/}" )
|
||||
commit="$(git log -1 --format='format:%H')"
|
||||
url='git://github.com/docker-library/postgres'
|
||||
|
||||
echo '# maintainer: InfoSiftr <github@infosiftr.com> (@infosiftr)'
|
||||
|
||||
for version in "${versions[@]}"; do
|
||||
commit="$(git log -1 --format='format:%H' "$version")"
|
||||
fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')"
|
||||
versionAliases=( ${aliases[$version]} $version $fullVersion )
|
||||
|
||||
|
@ -17,7 +17,8 @@ for version in "${versions[@]}"; do
|
||||
fullVersion="$(grep -m1 -A10 "^Package: postgresql-$version\$" "$packages" | grep -m1 '^Version: ' | cut -d' ' -f2)"
|
||||
(
|
||||
set -x
|
||||
cp Dockerfile.template "$version/Dockerfile"
|
||||
cp docker-entrypoint.sh Dockerfile.template "$version/"
|
||||
mv "$version/Dockerfile.template" "$version/Dockerfile"
|
||||
sed -i 's/%%PG_MAJOR%%/'$version'/g; s/%%PG_VERSION%%/'$fullVersion'/g' "$version/Dockerfile"
|
||||
)
|
||||
done
|
||||
|
Reference in New Issue
Block a user