Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Docker Compose #426

Open
NicholasFlamy opened this issue Dec 9, 2024 · 12 comments
Open

Feature Request: Docker Compose #426

NicholasFlamy opened this issue Dec 9, 2024 · 12 comments

Comments

@NicholasFlamy
Copy link

I wish there as a docker compose file I could configure (with the variant and stuff as well as output location and maybe cache location) to use for building FFmpeg using this repo's scripts automatically.

I would be willing to help, I'm just not sure how to go about the aspect that this already uses docker for most of the build but does stuff on the host around it.

@BtbN
Copy link
Owner

BtbN commented Dec 9, 2024

I don't see how that would work.
The Dockerfile is dynamically generated, as is the builder, and a bunch of other stuff for each build.
None of the containers in this setup are services that are longer running, which is what you'd usually use a compose file for.
What is your ultimate goal?

@NicholasFlamy
Copy link
Author

I don't see how that would work. The Dockerfile is dynamically generated, as is the builder, and a bunch of other stuff for each build. None of the containers in this setup are services that are longer running, which is what you'd usually use a compose file for. What is your ultimate goal?

My main goal is building without touching the host, and I'd prefer it in docker, but right now I'm most likely going to use a systemd-nspawn based approach.

@BtbN
Copy link
Owner

BtbN commented Dec 9, 2024

What do you mean, without touching the host?
You can probably run some "docker-in-docker" setup if you want to build entirely in a container.
But you won't get around invoking the usual build scripts. A compose file simply can't do what shellscripts can.

@NicholasFlamy
Copy link
Author

NicholasFlamy commented Dec 9, 2024

But you won't get around invoking the usual build scripts. A compose file simply can't do what shellscripts can.

I know that compose can build a dockerfile so I thought that could potentially be part of the system.

@BtbN
Copy link
Owner

BtbN commented Dec 9, 2024

There is a ton more stuff involved than just building some Dockerfile.
Just look at the couple top level scripts.
You'd have to somehow make a compose file do all that, which I'm pretty sure is straight up not possible.

This is simply not some server-side service you can host. So I'm still confused what host is there to not touch.

@NicholasFlamy
Copy link
Author

There is a ton more stuff involved than just building some Dockerfile.
Just look at the couple top level scripts.
You'd have to somehow make a compose file do all that, which I'm pretty sure is straight up not possible.

I was thinking that the docker compose could run a Dockerfile that clones the GitHub repo and runs a different version of makeimage.sh and build.sh that can still call all the other build scripts, just that instead of also building and running a docker container, it could do everything within the docker container created by docker compose.

This is simply not some server-side service you can host. So I'm still confused what host is there to not touch.

I have a setup where my server builds a custom ffmpeg and places it in a specific folder which I mount to docker containers as a modified ffmpeg. I'd intend for a docker compose version to start the build on docker compose up and for it to stop itself when finished.

@BtbN
Copy link
Owner

BtbN commented Dec 9, 2024

That's just not possible.
If you can spin up a docker-in-docker setup, you should be able to just run the scripts as normal.
But that's out of scope for this repo.

@NicholasFlamy
Copy link
Author

The easiest way I could do this currently I think, is if I had a docker compose that builds a Dockerfile that installs docker and clones your repo and then the docker compose uses entrypoint to run makeimage.sh and build.sh. I'd also have to figure out how to mount the cache to a dir on the host and also add a command to copy ffmpeg to a dir mounted to the host.

@NicholasFlamy
Copy link
Author

docker-in-docker setup

The main thing I don't like is that seems it'd be slower/less efficient.

@BtbN
Copy link
Owner

BtbN commented Dec 9, 2024

docker is not a VM. So I don't think there is any notable performance difference.

@NicholasFlamy
Copy link
Author

docker is not a VM.

Yep.

So I don't think there is any notable performance difference.

That's good, the only other complication is mounting the cache to the host so that it's not completely reset every time.

I think I'll most likely end up setting this up using systemd-nspawn though. (My current setup is a different, lesser build script in systemd-nspawn with a combination of scripts I created to set it up and run it.)

@NicholasFlamy
Copy link
Author

Thank you so much for your time, I appreciate the conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants