CrunchyData / pg_featureserv

Lightweight RESTful Geospatial Feature Server for PostGIS in Go
Apache License 2.0
459 stars 91 forks source link

Using alpine instead of centos as a base image #148

Open simonseyock opened 1 year ago

simonseyock commented 1 year ago

We ran a vulnerabilites scan on the image and detected quite some problems of which many are related to the centos base image.

I tried replacing the base image for alpine and used it in our project, it worked without any problems and reduced the size of the image by 90%.

image

I would suggest switching the base image if there are no bigger concerns about it.

simonseyock commented 1 year ago

I found this PR, that also used a multistage build which seems not to be necessary: https://github.com/CrunchyData/pg_featureserv/pull/120

The only difference there in the image is the addition of the ca-certificates package. This is probably needed for https support which I did not test.

simonseyock commented 1 year ago

Is this something which is doable? Either replacing the base image or adding a second alpine image?

I can work on developing the existing PR by @jingsam.

I like the multistage build idea thats included in the PR, I think that is a good approach to make the image building consistent between different build systems.

simonseyock commented 10 months ago

@dr-jts or @pramsey, I don't want to bother, but do you have any opinions about this?

pramsey commented 10 months ago

We have a PR ongoing that will result in a much smaller base image, though still not an alpine base, see #154

simonseyock commented 10 months ago

That looks quite promising, thanks!