zlacker

[parent] [thread] 7 comments
1. 3eb798+(OP)[view] [source] 2025-12-18 04:15:14
Never looked into this. I would expect the majority of images would fail in this configuration. Or am I unduly pessimistic?
replies(4): >>s_ting+d7 >>hxtk+09 >>flower+ic >>tracke+nv2
2. s_ting+d7[view] [source] 2025-12-18 05:48:39
>>3eb798+(OP)
Depends on specific app use case. Nginx doesn't work with it but valkey will.
3. hxtk+09[view] [source] 2025-12-18 06:07:32
>>3eb798+(OP)
Many fail if you do it without any additional configuration. In Kubernetes you can mostly get around it by mounting `emptyDir` volumes to the specific directories that need to be writable, `/tmp` being a common culprit. If they need to be writable and have content that exists in the base image, you'd usually mount an emptyDir to `/tmp` and copy the content into it in an `initContainer`, then mount the same `emptyDir` volume to the original location in the runtime container.

Unfortunately, there is no way to specify those `emptyDir` volumes as `noexec` [1].

I think the docker equivalent is `--tmpfs` for the `emptyDir` volumes.

1: https://github.com/kubernetes/kubernetes/issues/48912

4. flower+ic[view] [source] 2025-12-18 06:48:58
>>3eb798+(OP)
Readonly and rootless are my two requirements for Docker containers. Most images can't run readonly because they try to create a user in some startup script. Since I want my UIDs unique to isolate mounted directories, this is meaningless. I end up having to wrap or copy Dockerfiles to make them behave reasonably.

Having such a nice layered buildsystem with mountpoints, I'm amazed Docker made readonly an afterthought.

replies(1): >>subscr+4j
◧◩
5. subscr+4j[view] [source] [discussion] 2025-12-18 07:59:08
>>flower+ic
I like steering docker runs with docker-compose, especially with .env files - easy to store in repositories, easy to customise and have sane defaults.
replies(1): >>flower+4I
◧◩◪
6. flower+4I[view] [source] [discussion] 2025-12-18 11:53:47
>>subscr+4j
Yeah agreed. I use docker-compose. But it doesn't help if the Docker images try to update /etc/passwd, or force a hardcoded UID, or run some install.sh at runtime instead of buildtime.
replies(1): >>subscr+VJj
7. tracke+nv2[view] [source] 2025-12-18 20:48:47
>>3eb798+(OP)
It's hit or miss... you sometimes have to make /tmp writable or another data directory... some images just don't operate right because of initialization steps that happen on first run. It's hit or miss and depends... but a lot of your own apps can definitely be made to work with limited, or no write surface.
◧◩◪◨
8. subscr+VJj[view] [source] [discussion] 2025-12-25 14:50:30
>>flower+4I
Oh, absolutely. Some things some images try to do are just silly.
[go to top]