just-containers / s6-overlay

s6 overlay for containers (includes execline, s6-linux-utils & a custom init)
Other
3.76k stars 211 forks source link

Proposal: Adopting Docker images as distribution/installation method #592

Open flokoe opened 2 months ago

flokoe commented 2 months ago

Hi there,

I would like to propose adopting a new distribution/installation method in addition to the existing one via the ADD directive and making the content of the tarballs also available as Docker images so that we can use the COPY directive instead. This would have the following benefits:

I see two possibilities: one image per tarball, or a single image containing the contents of the tarballs in corresponding subdirectories.

It could look something like this:

# Singe image with digest, copying multiple "tarballs" into new image.
# A multi-arch image would automatically select the correct architecture.
FROM alpine:latest

COPY --link \
  --from=just-containers/s6-overlay:v3.2.0.0@sha256:17d70c7e8e374f772c0d0539f2e794b15701a50c48cc52cebea20d96e017c95f \
  /s6-overlay-noarch /s6-overlay-arch /

# Different images per tarball.
# A multi-arch image would automatically select the correct architecture.
FROM alpine:latest

COPY --link \
  --from=just-containers/s6-overlay-noarch:v3.2.0.0@sha256:933e09abf7298e4af67d18a54391b65c207e2181e143b5489e064b3078f37aed \
  / /

COPY --link \
  --from=just-containers/s6-overlay-arch:v3.2.0.0@sha256:4d6c5e083fb05bb2700740cc0a2f26e1307afac63da3ccf3d81efa0a0e8375f2 \
  / /

File permissions are preserved and directories are merged. Any conflicts are resolved in favor of the content being added.

I would love to hear your thoughts on this. If you are interested, I could submit a PR with the necessary Dockerfiles and GitHub Actions workflows to automate the builds.

skarnet commented 2 months ago

Sorry, I have exactly zero available bandwidth at the moment, I'll get back to you later. @jprjr, if you're around, can you please take a look and say if it's reasonable and doesn't require too much work?

flokoe commented 2 months ago

Sorry, I have exactly zero available bandwidth at the moment, I'll get back to you later. @jprjr, if you're around, can you please take a look and say if it's reasonable and doesn't require too much work?

No worries. Like I said, I am happy to provide all the necessary Dockerfiles, workflows, docs etc. if you are interested.

crazy-max commented 3 weeks ago

Seems similar to this proposal https://github.com/just-containers/s6-overlay/issues/386#issuecomment-1053055397 (dockerfile can be seen here: https://github.com/crazy-max/docker-alpine-s6/blob/master/Dockerfile)

skarnet commented 3 weeks ago

@flokoe Okay, sorry for the delay. So, I have a few comments about the benefits of that approach:

More generally, I said initially that I didn't want to be in charge of the s6-overlay project: I maintain it because it's useful to people, and because it's currently the most popular use of s6. I am okay with the development side of things, and we had an agreement with @jprjr that he would handle the ops side of things. But it doesn't seem like he wants to be involved any more; so if it's going to be just me, I'm going to touch the ops side as little as possible. Containers are something I'm involved with because it's where my software is used; but I don't want them to consume my time, so if it's not broken, I'm not going to fix it.

So, yeah, if you're willing to provide a proof of concept with Dockerfiles and GitHub actions that I could play with to see how it would go, sure, why not; but expect to have to provide a lot of patient explanations, and opinions and point of views that are probably rather different from your usual container software provider. Sorry for being so conservative and reluctant about this; but managing my priorities is absolutely necessary.

skarnet commented 3 weeks ago

@crazy-max It doesn't sound similar to your project; basically, what you're doing is rewriting the build system in the Dockerfile language, which I don't see the benefit of at all. Whereas if I understand correctly, @flokoe seems to want to keep the existing build, just provide different end outputs via Github actions voodoo, to integrate with various user workflows.