Perl / docker-perl

Dockerfiles for index.docker.io (official Perl Docker image)
https://registry.hub.docker.com/_/perl/
Artistic License 2.0
117 stars 51 forks source link

Adds out of the box SSL support w/ IO::Socket::SSL #118

Closed waterkip closed 2 years ago

waterkip commented 2 years ago

I was reading domm's blogpost^1 and domm has some (imo) valid points in using the slim image and not have SSL support out of the box. Because p5p hasn't made a decision yet on how to get out of the box SSL support^2 we are somewhat left with our own solutions. Since we now have a discussion about using cpm and we want to use https endpoints to install packages it would made sense to have the images support SSL by default as well. This is an attempt to do so.

The original commit message:

The new Dockerfiles preinstalls IO::Socket::SSL with its dependencies to give users out of the box SSL support. For slim builds we also keep the lib32z1-dev libssl-dev packages so when people run cpanm Net::SSLeay and it can be upgraded it won't cause issues.

It slightly increases the resulting image from 144MB to 197MB

Signed-off-by: Wesley Schwengle wesley@opperschaap.net

zakame commented 2 years ago

Thanks @waterkip, looks good! 💯

Maybe we can add a test step here after https://github.com/Perl/docker-perl/blob/9e28e527081bb65c9c91469836d96fd1581cca5d/.github/workflows/build-image.yml#L51-L55

to test SSL access? e.g. docker run "$img" perl -MHTTP::Tiny -E 'say HTTP::Tiny->new->get("https://github.com")->{status}'

waterkip commented 2 years ago

Maybe we can add a test step here after

https://github.com/Perl/docker-perl/blob/9e28e527081bb65c9c91469836d96fd1581cca5d/.github/workflows/build-image.yml#L51-L55

to test SSL access? e.g. docker run "$img" perl -MHTTP::Tiny -E 'say HTTP::Tiny->new->get("https://github.com")->{status}'

I've added:

docker run "$img" perl -MHTTP::Tiny -E 'if (HTTP::Tiny->new->get("https://github.com")->{status} == 200) { exit 0 } exit 1'

I'm assuming a non-zero exit fails the test, as I'm not familiar with github workflows.

zakame commented 2 years ago

Thanks again @waterkip, this is fine 💯 merging this now 👍