Skip to content

Conversation

@bkmit
Copy link
Contributor

@bkmit bkmit commented Sep 25, 2020

Do not remove static postgres libraries from Alpine based images.
This add near 1.4MB to image size, but allow to complie some extentions
like repmgr without errors

@tianon
Copy link
Member

tianon commented Sep 25, 2020

Would it be possible to give a simple example Dockerfile that fails to build now that works after this change?

@bkmit
Copy link
Contributor Author

bkmit commented Sep 25, 2020

FROM postgres:12.4-alpine
RUN apk add --no-cache     \
        bsd-compat-headers \
        clang              \
        flex               \
        fortify-headers    \
        gcc                \
        git                \
        libedit-dev        \
        libxml2-dev        \
        libxslt-dev        \
        linux-headers      \
        llvm10-dev         \
        make               \
        musl-dev           \
        openssl-dev
ARG REPMGR_VERSION=master
RUN git clone --branch "${REPMGR_VERSION}" https://github.com/2ndQuadrant/repmgr
WORKDIR /tmp/repmgr
RUN ./configure
RUN make USE_PGXS=1 install

@tianon
Copy link
Member

tianon commented Sep 25, 2020

Thanks!

I had to change RUN git clone --branch "${REPMGR_VERSION}" https://github.com/2ndQuadrant/repmgr to include /tmp/repmgr at the end (to declare the target directory), but I've verified that this does indeed enable that! 👍

Do not remove static postgres libraries from Alpine based images.
This add near 1.4MB to image size, but allow to complie some extentions
like repmgr without errors
@bkmit
Copy link
Contributor Author

bkmit commented Sep 25, 2020

Have updated PR to not delete empty lines

@tianon
Copy link
Member

tianon commented Sep 25, 2020

Nice work, thank you! LGTM 👍

@tianon tianon merged commit b80fcb5 into docker-library:master Sep 25, 2020
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Sep 26, 2020
Changes:

- docker-library/postgres@b80fcb5: Merge pull request docker-library/postgres#764 from maytech/master
- docker-library/postgres@04bf35f: Keep postgres static libraries in Alpine images
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