Skip to content

Add ossp uuid to the alpine 9.2 and 9.3 images #255

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 2 commits into from
Mar 6, 2017
Merged

Add ossp uuid to the alpine 9.2 and 9.3 images #255

merged 2 commits into from
Mar 6, 2017

Conversation

regisbelson
Copy link
Contributor

@regisbelson regisbelson commented Jan 26, 2017

The 9.3 alpine image builds postgres with all the extensions (make install-world) but it's missing --with-ossp-uuid.
Just adding it is not enough because it seems like uuid.h from util-linux-dev doesn't satisfy the check for libuuid, it's looking for uuid_export which isn't present in that version of uuid.h.

checking for uuid_export in -lossp-uuid... no
checking for uuid_export in -luuid... no
configure: error: library 'ossp-uuid' or 'uuid' is required for OSSP-UUID

Because of this, I added ossp-uuid to the image. I had to use a mirror because the official ftp server is not reliable (it often fails with CONNECTION_REFUSED).
It also doesn't increase the size of the image significantly (+0.2 MB).

REPOSITORY                  TAG                           IMAGE ID            CREATED             SIZE
postgres                    9.3-alpine                    da793c57faa1        3 minutes ago       35.3 MB
postgres                    9.3-alpine-ossp-uuid          c3f3d3cd3d52        20 minutes ago      35.5 MB

I also removed 2 of the configure flags since they're not recognized :

configure: WARNING: unrecognized options: --enable-tap-tests, --with-uuid

@regisbelson
Copy link
Contributor Author

I just realized that both of these points only apply to version 9.3. What's the correct approach (I'm thinking about the template) to use the ossp-uuid lib on 9.3 and --with-uuid=e2fs on 9.4+ ?

@regisbelson regisbelson changed the title Add ossp uuid Add ossp uuid to the alpine 9.3 image Jan 26, 2017
@tianon
Copy link
Member

tianon commented Jan 26, 2017

Can you elaborate on what the benefits of doing this might be? This isn't something that's done for the Debian packages (https://sources.debian.net/src/postgresql-9.6/9.6.1-2/debian/rules/#L74), which is where our ./configure flags came from (since we're trying to emulate upstream's own released packages as closely as possible), so I'm pretty strongly -1 at a first glance, but could be convinced (strongest argument would be an explicit recommendation from upstream that this is preferred).

@regisbelson
Copy link
Contributor Author

This is only for version 9.3. The uuid-ossp extension isn't installed on the 9.3-alpine flavor of this image but it's there for all the other versions.

9.4-alpine:

docker run -t -i --rm  postgres:9.4-alpine bash -c 'ls /usr/local/share/postgresql/extension/uuid*'
/usr/local/share/postgresql/extension/uuid-ossp--1.0.sql
/usr/local/share/postgresql/extension/uuid-ossp--unpackaged--1.0.sql
/usr/local/share/postgresql/extension/uuid-ossp.control

9.3-alpine:

docker run -t -i --rm  postgres:9.3-alpine bash -c 'ls /usr/local/share/postgresql/extension/uuid*'
ls: /usr/local/share/postgresql/extension/uuid*: No such file or directory

The flag --with-uuid is only valid for 9.4+, for 9.3 you have to use --with-ossp-uuid and you need the ossp-uuid library.

@tianon
Copy link
Member

tianon commented Jan 27, 2017

Ah! Grabbing http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.3/postgresql-9.3_9.3.15-1.pgdg80%2b1.debian.tar.xz and looking at debian/rules:

  --mandir=/usr/share/postgresql/$(MAJOR_VER)/man \
  --docdir=/usr/share/doc/postgresql-doc-$(MAJOR_VER) \
  --sysconfdir=/etc/postgresql-common \
  --datarootdir=/usr/share/ \
  --datadir=/usr/share/postgresql/$(MAJOR_VER) \
  --bindir=/usr/lib/postgresql/$(MAJOR_VER)/bin \
  --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/ \
  --libexecdir=/usr/lib/postgresql/ \
  --includedir=/usr/include/postgresql/ \
  --enable-nls \
  --enable-integer-datetimes \
  --enable-thread-safety \
  --enable-debug \
  --disable-rpath \
  --with-ossp-uuid \
  --with-gnu-ld \
  --with-pgport=5432 \
  --with-system-tzdata=/usr/share/zoneinfo \

And over in debian/control:

Build-Depends: ...
...
 libossp-uuid-dev,
...

@tianon
Copy link
Member

tianon commented Jan 27, 2017

Alpine digging leads to https://bugs.alpinelinux.org/issues/4832, http://git.alpinelinux.org/cgit/aports/commit/?id=13925b3651ff86ea00c3864814eb83e0fb0862b3, and https://patchwork.alpinelinux.org/patch/933/, none of which really help shrink this 9.3-specific delta any. 😞

@regisbelson
Copy link
Contributor Author

Technically, --with-ossp-uuid could be used for all versions, it's an alias for --with-uuid=ossp on 9.4+.
On 9.4+ the build process looks for uuid_generate instead of uuid_export if it's not ossp-uuid , that's the reason why you can use other uuid libraries. 😕

@regisbelson regisbelson reopened this Jan 27, 2017
@regisbelson
Copy link
Contributor Author

Clicked on the wrong button. 😑

@regisbelson regisbelson changed the title Add ossp uuid to the alpine 9.3 image Add ossp uuid to the alpine 9.2 and 9.3 images Jan 28, 2017
@regisbelson
Copy link
Contributor Author

It actually also applies to 9.2.

@regisbelson
Copy link
Contributor Author

I modified the update script to add ossp-uuid to the 9.2 and 9.3 alpine images and also to remove the --enable-tap-tests flag. It removes the unused placeholders and uses --with-uuid=e2fs for 9.4+. Let me know if I missed something.

@regisbelson
Copy link
Contributor Author

We're running a custom 9.3-alpine image because of this issue, it would be nice if we could drop it and just use the official one. 🙂

@tianon
Copy link
Member

tianon commented Mar 6, 2017

Thanks for your patience -- I rebased and added a minor commit, and I suppose this will do for now (sad that we can't remove the disparity until Oct 2018 when 9.3 is EOL, but oh well). 👍 ❤️

@tianon
Copy link
Member

tianon commented Mar 6, 2017

(Will merge as soon as Travis is green as one final smoke test)

@yosifkit yosifkit merged commit 64e333f into docker-library:master Mar 6, 2017
tianon added a commit to infosiftr/stackbrew that referenced this pull request Mar 7, 2017
- `postgres`: add OSSP uuid to 9.2 and 9.3 Alpine images (docker-library/postgres#255)
@regisbelson regisbelson deleted the add-ossp-uuid branch March 8, 2017 10:14
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.

3 participants