Skip to content

Commit 3bad836

Browse files
committed
Merge pull request #8 from infosiftr/more-tweaks
Add more minor tweaks to generate-stackbrew-library.sh and update.sh
2 parents f627096 + 4540606 commit 3bad836

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

docker-entrypoint.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ "$1" = 'postgres' ]; then
5+
chown -R postgres "$PGDATA"
6+
7+
if [ -z "$(ls -A "$PGDATA")" ]; then
8+
gosu postgres initdb
9+
10+
sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf
11+
12+
{ echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf
13+
fi
14+
15+
exec gosu postgres "$@"
16+
fi
17+
18+
exec "$@"

generate-stackbrew-library.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
1111

1212
versions=( */ )
1313
versions=( "${versions[@]%/}" )
14-
commit="$(git log -1 --format='format:%H')"
1514
url='git://github.com/docker-library/postgres'
1615

1716
echo '# maintainer: InfoSiftr <[email protected]> (@infosiftr)'
1817

1918
for version in "${versions[@]}"; do
19+
commit="$(git log -1 --format='format:%H' "$version")"
2020
fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')"
2121
versionAliases=( ${aliases[$version]} $version $fullVersion )
2222

update.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ for version in "${versions[@]}"; do
1717
fullVersion="$(grep -m1 -A10 "^Package: postgresql-$version\$" "$packages" | grep -m1 '^Version: ' | cut -d' ' -f2)"
1818
(
1919
set -x
20-
cp Dockerfile.template "$version/Dockerfile"
20+
cp docker-entrypoint.sh Dockerfile.template "$version/"
21+
mv "$version/Dockerfile.template" "$version/Dockerfile"
2122
sed -i 's/%%PG_MAJOR%%/'$version'/g; s/%%PG_VERSION%%/'$fullVersion'/g' "$version/Dockerfile"
2223
)
2324
done

0 commit comments

Comments
 (0)