librespeed / speedtest

Self-hosted Speed Test for HTML5 and more. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more
https://librespeed.org
GNU Lesser General Public License v3.0
12.05k stars 2.18k forks source link

Add alpine docker image version #631

Closed rare-magma closed 1 month ago

rare-magma commented 4 months ago

The alpine based php docker image results in a 5x reduction in image size when compared with the debian one (~125MB vs ~540MB)

sstidl commented 1 month ago

thank you very much for contributing @rare-magma i did look at the change but i cant see that you are creating the semver docker labels correctly.

the needed labels are major major.minor major.minor.hotfix major-alpine major.minor-alpine major.minor.hotfix-alpine latest latest-alpine

can you achive that?

rare-magma commented 1 month ago

@sstidl I've added the missing docker labels, could you please give it a try?

sstidl commented 1 month ago

@rare-magma i dont think i works as in your repo there are no tags matching the pattern. try to merge it in your master and make a release in your repo. then you should see something here: https://github.com/rare-magma/speedtest/pkgs/container/speedtest

rare-magma commented 1 month ago

@sstidl I've merged to main in my fork and it seems to work fine:

podman pull ghcr.io/rare-magma/speedtest:latest ghcr.io/rare-magma/speedtest:latest-alpine
podman images | grep speedtest
ghcr.io/rare-magma/speedtest   latest         3a7ff00e3229  12 minutes ago  518 MB
ghcr.io/rare-magma/speedtest   latest-alpine  d903eb3d8174  16 minutes ago  120 MB
sstidl commented 1 month ago

Looks good. You tagged v999.999.999

rare-magma commented 1 month ago

@sstidl yes I created v999.999.999 as a test, I'll delete the fork and its packages later once this is merged

sstidl commented 1 month ago

The image building looks good now. Thank you!

I saw that you picked php8.2 in the Dockerfile for alpine. Is there a reason not to use 8.3 there?

rare-magma commented 1 month ago

@sstidl I've bumped it to 8.3 on https://github.com/librespeed/speedtest/pull/631/commits/76bb7de0378480dd51901c6ed883da98d5a957d4

sstidl commented 1 month ago

@rare-magma thank you again for contributing. I just merged your changes.

We still need to add some documentation. I would appreciate if you could add something about the alpine flavour to the docker Readme. If you have time.

@adolfintel FYI

rare-magma commented 1 month ago

@sstidl I've created a PR with more info on the alpine variant: https://github.com/librespeed/speedtest/pull/654

adolfintel commented 1 month ago

Yeah this looks absolutely fine :)

Sorry it took so long to merge it, thanks for your contribution.