-
Notifications
You must be signed in to change notification settings - Fork 42
Upgrade pgweb to a non-EOL debian image #477
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,45 @@ | ||
| FROM sosedoff/pgweb@sha256:a5256d416e2e8b92d69a4459058e3eca33a9f075d8325491644411d0bc3bd70b | ||
| FROM sosedoff/pgweb@sha256:a5256d416e2e8b92d69a4459058e3eca33a9f075d8325491644411d0bc3bd70b AS pgweb | ||
|
|
||
| # We extract just the pgweb binary and rebuild the rest of this Dockerfile | ||
| # ourselves so we can pin/update the base OS independently of upstream. | ||
| # TODO: remove this workaround once sosedoff/pgweb publishes an image with | ||
| # an up-to-date OS and we can go back to using it directly. | ||
| FROM debian@sha256:d7e12182ce18b85b93007c1dedf31f2d29e01ccf3182cc4017c709b6259bc132 AS keyring | ||
| ADD https://www.postgresql.org/media/keys/ACCC4CF8.asc keyring.asc | ||
| RUN apt-get update && \ | ||
| apt-get install -qq --no-install-recommends gpg | ||
| RUN gpg -o keyring.pgp --dearmor keyring.asc | ||
|
|
||
| FROM debian@sha256:d7e12182ce18b85b93007c1dedf31f2d29e01ccf3182cc4017c709b6259bc132 | ||
|
|
||
| USER root | ||
|
|
||
| RUN apt-get update && \ | ||
| apt-get -y install sudo && \ | ||
| ARG keyring=/usr/share/keyrings/postgresql-archive-keyring.pgp | ||
| COPY --from=keyring /keyring.pgp $keyring | ||
|
|
||
| # Use the official postgresql.org apt repo (rather than Debian's bundled | ||
| # packages) so we get a current postgresql-client, matching upstream: | ||
| # https://github.com/sosedoff/pgweb/blob/master/Dockerfile | ||
| RUN . /etc/os-release && \ | ||
| echo "deb [signed-by=${keyring}] http://apt.postgresql.org/pub/repos/apt/ ${VERSION_CODENAME}-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ | ||
| apt-get update && \ | ||
| apt-get -y install --no-install-recommends \ | ||
| ca-certificates \ | ||
| curl \ | ||
| netcat-openbsd \ | ||
| openssl \ | ||
| postgresql-client \ | ||
| sudo && \ | ||
| apt-get -y clean && \ | ||
| rm -rf /var/lib/apt/lists/* && \ | ||
| useradd --uid 1000 --no-create-home --shell /bin/false pgweb && \ | ||
| mkdir -p /pgweb && \ | ||
| chown pgweb:pgweb /pgweb | ||
|
|
||
| COPY --from=pgweb /usr/bin/pgweb /usr/bin/pgweb | ||
|
|
||
| USER pgweb | ||
|
|
||
| EXPOSE 8081 | ||
|
|
||
| ENTRYPOINT ["/usr/bin/pgweb", "--bind=0.0.0.0", "--listen=8081"] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.