{"action":"created","issue":{"url":"https://api.github.com/repos/docker-library/postgres/issues/384","repository_url":"https://api.github.com/repos/docker-library/postgres","labels_url":"https://api.github.com/repos/docker-library/postgres/issues/384/labels{/name}","comments_url":"https://api.github.com/repos/docker-library/postgres/issues/384/comments","events_url":"https://api.github.com/repos/docker-library/postgres/issues/384/events","html_url":"https://github.com/docker-library/postgres/issues/384","id":278547360,"node_id":"MDU6SXNzdWUyNzg1NDczNjA=","number":384,"title":"Language pack availability/strategy for <= 9.5 alpine","user":{"login":"cdaringe","id":1003261,"node_id":"MDQ6VXNlcjEwMDMyNjE=","avatar_url":"https://avatars0.githubusercontent.com/u/1003261?v=4","gravatar_id":"","url":"https://api.github.com/users/cdaringe","html_url":"https://github.com/cdaringe","followers_url":"https://api.github.com/users/cdaringe/followers","following_url":"https://api.github.com/users/cdaringe/following{/other_user}","gists_url":"https://api.github.com/users/cdaringe/gists{/gist_id}","starred_url":"https://api.github.com/users/cdaringe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdaringe/subscriptions","organizations_url":"https://api.github.com/users/cdaringe/orgs","repos_url":"https://api.github.com/users/cdaringe/repos","events_url":"https://api.github.com/users/cdaringe/events{/privacy}","received_events_url":"https://api.github.com/users/cdaringe/received_events","type":"User","site_admin":false},"labels":[{"id":101614646,"node_id":"MDU6TGFiZWwxMDE2MTQ2NDY=","url":"https://api.github.com/repos/docker-library/postgres/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-12-01T18:00:50Z","updated_at":"2018-08-24T20:35:07Z","closed_at":"2018-08-24T20:35:07Z","author_association":"NONE","body":"# problem\r\n\r\nlanguage packs (plpython) aren't available in any alpine version official repos for pg <= 9.5.x\r\n\r\n# discussion\r\n\r\nalpine doesn't ship a plpython for postgres 9.5.x/9.5.10, and im struggling to find documentation on how to load it.\r\n\r\n- i've tried downloading the 9.5 source and compiling it, but still not clear which artifacts are relevant and where they go!\r\n- with some help on getting it loaded, i'd gladly flip a PR back here to the README.md to help others w/ the same issue"},"comment":{"url":"https://api.github.com/repos/docker-library/postgres/issues/comments/415875299","html_url":"https://github.com/docker-library/postgres/issues/384#issuecomment-415875299","issue_url":"https://api.github.com/repos/docker-library/postgres/issues/384","id":415875299,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTg3NTI5OQ==","user":{"login":"tianon","id":161631,"node_id":"MDQ6VXNlcjE2MTYzMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/161631?v=4","gravatar_id":"","url":"https://api.github.com/users/tianon","html_url":"https://github.com/tianon","followers_url":"https://api.github.com/users/tianon/followers","following_url":"https://api.github.com/users/tianon/following{/other_user}","gists_url":"https://api.github.com/users/tianon/gists{/gist_id}","starred_url":"https://api.github.com/users/tianon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tianon/subscriptions","organizations_url":"https://api.github.com/users/tianon/orgs","repos_url":"https://api.github.com/users/tianon/repos","events_url":"https://api.github.com/users/tianon/events{/privacy}","received_events_url":"https://api.github.com/users/tianon/received_events","type":"User","site_admin":false},"created_at":"2018-08-24T20:35:07Z","updated_at":"2018-08-24T20:35:07Z","author_association":"MEMBER","body":"I was able to successfully perform `CREATE EXTENSION plpythonu;` within an image `FROM postgres:10-alpine` by using the following `Dockerfile` (which borrows heavily from the main PostgreSQL `Dockerfile`):\r\n\r\n```dockerfile\r\nFROM postgres:10-alpine\r\n\r\nRUN set -eux; \\\r\n\t\\\r\n\tapk add --no-cache --virtual .fetch-deps \\\r\n\t\tca-certificates \\\r\n\t\topenssl \\\r\n\t\ttar \\\r\n\t; \\\r\n\t\\\r\n\twget -O postgresql.tar.bz2 \"https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2\"; \\\r\n\techo \"$PG_SHA256 *postgresql.tar.bz2\" | sha256sum -c -; \\\r\n\tmkdir -p /usr/src/postgresql; \\\r\n\ttar \\\r\n\t\t--extract \\\r\n\t\t--file postgresql.tar.bz2 \\\r\n\t\t--directory /usr/src/postgresql \\\r\n\t\t--strip-components 1 \\\r\n\t; \\\r\n\trm postgresql.tar.bz2; \\\r\n\t\\\r\n\tapk add --no-cache --virtual .build-deps \\\r\n\t\tcoreutils \\\r\n\t\tdpkg-dev dpkg \\\r\n\t\tgcc \\\r\n\t\tlibc-dev \\\r\n\t\tlibedit-dev \\\r\n\t\tmake \\\r\n\t\tpython-dev \\\r\n\t\tzlib-dev \\\r\n\t; \\\r\n\t\\\r\n\tcd /usr/src/postgresql; \\\r\n\tgnuArch=\"$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)\"; \\\r\n# explicitly update autoconf config.guess and config.sub so they support more arches/libcs\r\n\twget -O config/config.guess 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=7d3d27baf8107b630586c962c057e22149653deb'; \\\r\n\twget -O config/config.sub 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=7d3d27baf8107b630586c962c057e22149653deb'; \\\r\n# configure options taken from:\r\n# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5\r\n\t./configure \\\r\n\t\t--build=\"$gnuArch\" \\\r\n\t\t--prefix=/usr/local \\\r\n\t\t--with-includes=/usr/local/include \\\r\n\t\t--with-libraries=/usr/local/lib \\\r\n\t\t--with-python \\\r\n\t; \\\r\n\tcd src/pl/plpython; \\\r\n\tmake -j \"$(nproc)\"; \\\r\n\tmake install; \\\r\n\tfind /usr/local -iname '*plpython*' \\\r\n\t\t-exec scanelf --needed --nobanner --format '%n#p' '{}' + \\\r\n\t\t| tr ',' '\\n' \\\r\n\t\t| sort -u \\\r\n\t\t| awk 'system(\"[ -e /usr/local/lib/\" $1 \" ]\") == 0 { next } { print \"so:\" $1 }' \\\r\n\t\t| xargs -rt apk add \\\r\n\t; \\\r\n\tapk del .fetch-deps .build-deps; \\\r\n\tcd /; \\\r\n\trm -rf \\\r\n\t\t/usr/src/postgresql \\\r\n\t\t/usr/local/share/doc \\\r\n\t\t/usr/local/share/man \\\r\n\t; \\\r\n\tfind /usr/local -name '*.a' -delete\r\n```\r\n\r\nSo in short, this _is_ possible to add after the fact without recompiling all of PostgreSQL. :metal:"}}
{"actor":{"display_login":"tianon"}}