postmanlabs / httpbin

HTTP Request & Response Service, written in Python + Flask.
https://httpbin.org
ISC License
12.83k stars 1.82k forks source link

Refactor to alpine #698

Open pflaeging opened 1 year ago

pflaeging commented 1 year ago

httpbin with compact alpine container

The goal is:

build

We are building the containers with podman (podman-desktop under MacOS or Windows):

podman build --manifest quay.io/pflaeging/httpbin:0.9.2-alpine --rm --no-cache --platform linux/amd64 --platform linux/arm64 -f Dockerfile.alpine .
podman manifest push quay.io/pflaeging/httpbin:0.9.2-alpine docker://quay.io/pflaeging/httpbin:0.9.2-alpine --rm

(please replace the quay.io/pflaeging part with your own registry place)

Kubernetes rollout

The application is fully compatible with Kubernetes / OpenShift4 / OKD4.

Example objects are in the folder ./kubernetes/.

MikeRalphson commented 1 year ago

Could you address the performance and stability concerns raised in https://pythonspeed.com/articles/alpine-docker-python/ ?

We might also need to break up this PR so the unrelated bug / dependency changes can be reviewed separately.

pflaeging commented 1 year ago

Could you address the performance and stability concerns raised in https://pythonspeed.com/articles/alpine-docker-python/ ?

We're using alpine normally not because of built-time or size. It's more a matter of security. Normally alpine images are containing fewer packages and so there less affected to CVE's. But I will also make a config with ubi8 / microubi for the deployment on secure OpenShift installations. We also normally using build container configs. You get a smaller and more controllable image in production.

We might also need to break up this PR so the unrelated bug / dependency changes can be reviewed separately.

I've addressed 3 tasks in my PR:

At least the last 2 are a little dependent, 'cause the build doesn't work with the old versions. The k8s deployment is more independent.

:peter

retornam commented 1 year ago

@MikeRalphson thanks to PEP-0656 and this PR that blog post is no longer true.