Skip to content

Add 10~beta1 #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 22, 2017
Merged

Add 10~beta1 #303

merged 6 commits into from
Jun 22, 2017

Conversation

yosifkit
Copy link
Member

Fixes #293

Also bump jessie to stretch and alpine 3.5 to 3.6 for postgres 10. We can discuss separately the bumping of other versions of postgres to stretch or 3.6.

# git --no-pager diff --no-index 9.6/ 10/
diff --git a/9.6/Dockerfile b/10/Dockerfile
index 4d13096..e5fca3b 100644
--- a/9.6/Dockerfile
+++ b/10/Dockerfile
@@ -1,5 +1,5 @@
 # vim:set ft=dockerfile:
-FROM debian:jessie
+FROM debian:stretch
 
 # explicitly set user/group IDs
 RUN groupadd -r postgres --gid=999 && useradd -r -g postgres --uid=999 postgres
@@ -36,8 +36,8 @@ RUN set -ex; \
 	rm -r "$GNUPGHOME"; \
 	apt-key list
 
-ENV PG_MAJOR 9.6
-ENV PG_VERSION 9.6.3-1.pgdg80+1
+ENV PG_MAJOR 10
+ENV PG_VERSION 10~beta1-1.pgdg90+1
 
 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
 
diff --git a/9.6/alpine/Dockerfile b/10/alpine/Dockerfile
index 8c998c1..8f7e15c 100644
--- a/9.6/alpine/Dockerfile
+++ b/10/alpine/Dockerfile
@@ -1,5 +1,5 @@
 # vim:set ft=dockerfile:
-FROM alpine:3.5
+FROM alpine:3.6
 
 # alpine includes "postgres" user/group in base install
 #   /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
@@ -21,9 +21,9 @@ ENV LANG en_US.utf8
 
 RUN mkdir /docker-entrypoint-initdb.d
 
-ENV PG_MAJOR 9.6
-ENV PG_VERSION 9.6.3
-ENV PG_SHA256 1645b3736901f6d854e695a937389e68ff2066ce0cde9d73919d6ab7c995b9c6
+ENV PG_MAJOR 10
+ENV PG_VERSION 10beta1
+ENV PG_SHA256 7eee02e6f6646c7d4d6e78893a4ff638cfa5f1025b706712da8c6ef2257b5e29
 
 RUN set -ex \
 	\

@yosifkit yosifkit requested a review from tianon June 21, 2017 23:09
@@ -9,25 +9,51 @@ if [ ${#versions[@]} -eq 0 ]; then
fi
versions=( "${versions[@]%/}" )

packagesBase='http://apt.postgresql.org/pub/repos/apt/dists/jessie-pgdg'
mainList="$(curl -fsSL "$packagesBase/main/binary-amd64/Packages.bz2" | bunzip2)"
declare -A debianSuite=(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I debated using a default, like golang, but decided it just complicates logic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, if/when we get PostgreSQL 11, this will break, won't it? Is the idea just to force us to explicitly reconsider at that point which base we should use?

(Should probably update from set -eo pipefail to set -Eeuo pipefail like we've done in several other scripts to help ensure that breakage does occur, and gives a semi-sane error message about an unset variable in debianSuite.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Break all the things. (adding E and u to set)

@yosifkit yosifkit mentioned this pull request Jun 21, 2017
@yosifkit
Copy link
Member Author

Forgot stretch does not have gpg by default; changes incoming.

update.sh Outdated
lastSuite="${debianSuite[$version]}"
packagesBase='http://apt.postgresql.org/pub/repos/apt/dists/'"${debianSuite[$version]}"'-pgdg'
mainList="$(curl -fsSL "$packagesBase/main/binary-amd64/Packages.bz2" | bunzip2)"
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO since we don't run this very often, we might as well just ditch the optimization entirely and redownload every time (or use an associative array for cache instead).

update.sh Outdated
-e 's/%%PG_VERSION%%/'"$fullVersion"'/g' \
-e 's/%%DEBIAN_SUITE%%/'"${debianSuite[$version]}"'/g' \
Dockerfile-debian.template > "$version/Dockerfile"
if [ "$version" = '10' ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be safer as something like [ "${version%%.*}" != '9' ]; then so that we only keep this package on 9.x for now, rather than removing the package explicitly only for 10?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if it was a permanent change for 10 to provide contrib or if that was possibly only a change in the beta version. Doing it this way we get the failure on 10.1 when the package still does not exist instead of silently not installing it.

update.sh Outdated
)

# TODO figure out what to do with odd version numbers here, like release candidates
srcVersion="${fullVersion%%-*}"
# change "10~beta1" to "10beta1" for ftp urls
srcVersion="${srcVersion//\~/}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yummy -- I think some environments break on this, so what we usually do elsewhere is something like this:

tilde='~'
srcVersion="${srcVersion//$tilde/}"

- fail on unset vars so that missing suites on new version gives a more useful error
- prevent inconsistent bash handling of tilde in `${variable//~/}`
- use associative array for suite to packages.gz cache
@yosifkit yosifkit merged commit 0f55625 into docker-library:master Jun 22, 2017
@yosifkit yosifkit deleted the 10beta branch June 22, 2017 23:08
@yosifkit
Copy link
Member Author

Warding off the "where is it?":

See a change merged here that doesn't show up on the Docker Hub yet? Check the "library/postgres" manifest file in the docker-library/official-images repo, especially PRs with the "library/postgres" label on that repo. For more information about the official images process, see the docker-library/official-images readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants