Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mccaffers
Copy link

@mccaffers mccaffers commented Nov 15, 2022

Issue

The docker build is currently broken as Postgresql.org have removed support for Debian (9/Stretch).

2022-08-12: Debian stretch (9) is no longer supported and will be removed from apt.postgresql.org at the end of October
https://wiki.postgresql.org/wiki/Apt#News

Options

You could keep using the archived versions, by modifying line 3 of the ./Dockerfile

RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list && \

to

RUN echo 'deb http://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list && \

Or we could bump the versions up. I've experimented with bumping the versions up for Postgres, Go and Debian. This would allow us to take advantage of the various performance improvements of newer versions. Feel free to reject this though if you prefer the change above.

Proposed Changes

  1. Upgraded Go to version 1.19 (latest) and Debian to Bullseye (11)

  2. Change postgresql-client to reference version 13 (Bullseye provides postgresql-client-13, stable)
    https://packages.debian.org/bullseye/postgresql-client

  3. Switch the go command to just 'go install' with '@latest'

  4. Moved DEBIAN_FRONTEND=noninteractive to the top to keep the file cleaner. ARG's are only available to build so not leaked into the image.

ARG DEBIAN_FRONTEND=noninteractive
  1. Moved the cleanup commands quoted below, to execute after the requirements install. gcc is required to build psycopg2-binary
RUN apt-get purge -y --auto-remove \
      g++ gcc libc6-dev make git \
      && rm -rf /var/lib/apt/lists/*
  1. Removed the lock on the requirements as those versions are too old

  2. Switched the Postgres GIS from mdillon/postgis (4 years old, https://hub.docker.com/r/mdillon/postgis/) to postgis/postgis (https://github.com/postgis/docker-postgis)

File image is 1.33GB

Testing

Built locally on MacOS (Intel) and on AWS (ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2)

Test building
image

Tested Matla (5mb)
image
image

Tested Portugal (200mb)
image

image

@mccaffers mccaffers changed the title Update Dockerfile, bumping Go and Debian versions Update Dockerfile, bumping Postgres, Go and Debian versions Nov 15, 2022
@mccaffers mccaffers changed the title Update Dockerfile, bumping Postgres, Go and Debian versions Updated Dockerfile, bumping Postgres, Go and Debian versions Nov 15, 2022
@philippks
Copy link
Collaborator

philippks commented Nov 25, 2022

hey @mccaffers, what a nice PR, thanks for your work!

Any reasoning why you update to postgres/postgis version 13 and not the newest version 15? I tried it for some small exports and it seems to work as well (not sure about the performance impacts). But maybe you did some tests as well?

Edit: just saw Removed the lock on the requirements as those versions are too old now. I think it would make sense to keep the lock, but update it with the newest versions.

@mccaffers
Copy link
Author

mccaffers commented Dec 10, 2022

Thanks @philippks

Any reasoning why you update to postgres/postgis version 13 and not the newest version 15?

I think I had issues trying to get postgres version 15 working with osmnames. I'll get some results and share back

I'll share test results and update the requirements.lock with versions that work against the updated versions. I'll follow up asap.

@dagnelies
Copy link
Contributor

I'd suggest merging it for now, since the current Dockerfile is broken. That way, it would at least work for now. An update to v15 could still be done in a later PR.

philippks added a commit to philippks/OSMNames that referenced this pull request Feb 3, 2023
Credits go to mccaffers. I just used the newest versions:
OSMNames#209
@philippks
Copy link
Collaborator

I updated to the newest version in a separate PR, see #211

feel free to provide feedback. I'll merge it in a few days (I can't add externals as reviewers).

philippks added a commit to philippks/OSMNames that referenced this pull request Feb 3, 2023
Credits go to mccaffers. I just used the newest versions:
OSMNames#209
philippks added a commit that referenced this pull request Feb 3, 2023
Credits go to mccaffers. I just used the newest versions:
#209
@philippks
Copy link
Collaborator

I close this PR in favor of #211

thanks for your work @mccaffers

@philippks philippks closed this Feb 3, 2023
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