-
Notifications
You must be signed in to change notification settings - Fork 12
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
Added docker multistage build #25
base: master
Are you sure you want to change the base?
Conversation
|
||
WORKDIR /opt/postgresql-unit | ||
|
||
RUN curl -fsSL https://github.com/df7cb/postgresql-unit/archive/$PG_UNIT_VERSION.tar.gz | \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
why isn't this using the files from the very git repository you want to have this merged into? Pulling a (versioned) tarball from github instead doesn't seem right.
Alternatively, couldn't you just "apt-get install postgresql-$PG_VERSION-unit" instead?
Christoph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh! My mistake...
I didn't check the postgresql repos for your unit extension, just the ubuntu repos :(
Through the docker build, you get the flexibility to test different releases of your extension with different distros and psql versions, but the fact, that the extension is available in the psql apt repo ist making this pull request nearly obsolete...
Nevertheless a Docker Hub Image would be nice and is easily possible with this Dockerfile.
|
||
FROM postgres:11 | ||
|
||
COPY --from=0 /opt/postgresql-unit/unit.so /usr/lib/postgresql/$PG_MAJOR/lib/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it run make install
when it then proceeds to fetch the files from /opt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make install
is just for checking that the package installs right - indeed not necessary.
Should be commented out, I used it just for development purposes.
I'm currently using this FROM postgres:12 AS extension_builder
RUN apt-get update -y
RUN apt-get install wget -y
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get install postgresql-12-unit -y
FROM postgres:12
COPY --from=extension_builder /usr/lib/postgresql/12/lib /usr/lib/postgresql/12/lib
COPY --from=extension_builder /usr/share/postgresql/12/extension /usr/share/postgresql/12/extension based on the suggestion(s) here docker-library/postgres#340 (comment) Just wondering if there are any glaring problems with this approach? Thanks! |
Hey there, I added an easy docker approach for testing your extension.