You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tracks final changes to our CUE APIs before the 0.2 release. This includes:
universe.dagger.io
dagger.io
Realistically, Universe will not be finished or even fully stabilized, before the release. But we should try to pick as many low-hanging fruits as possible, to minimize future pain.
Changes
To propose a change, or ask about its status, please post a comment. If you're not sure if the change is relevant to this issue, post it anyway.
universe.dagger.io/docker:
It would be good to solve Nested docker.#Build fails #1466 , or at least find a good workaround and apply it consistently everywhere. At the moment, everyone is using their own method.
I haven't created an issue because I wanted to do investigate a bit and be more informed, but I think we need to check the usage around different combinations of having entrypoint, cmd, shell and argsescaped in the image config (in docker.#Run).
There's also an idea of simplifying docker.#Run internally with dagger.#Set, which has a small chance of changing the API, although I don't think it will be necessary.
Yes, I agree the new docker is important enough to deserve its own "last call" issue. I will create a placeholder and link to it from here.
Just took a brief look at the source - here are some quick comments (hope I did not misunderstand something obvious).
image:
couldn't find a way to #Pull an image for a specific platform
where to pass secrets that are used inside a Dockerfile on #Dockerfile (eg: RUN --mount=type=secret) - more generally, how do you pass mounts to #Dockerfile?
how to specify cache_to, cache_from on #Dockerfile
platforms is here on #Dockerfile but I do not understand how that would work (or for #Push for that matter) - then looking at Multi-platform containers #1371 makes me wonder if it's implemented at all? Maybe it's not part of the Europa milestone then (it would very likely impact the CUE API right?)
docker:
at some point there was code to start containers on remote docker hosts (based on a wrapper around docker cli IIRC) - looks like #Run is now purely based on #Exec which doesn't seem to allow that anymore - maybe I missed something? or was the previous component removed from universe?
#Run seems to be missing a number of useful features (devices, group_add, caps, network, ...)
Good to see you back in the neighborhood @dubo-dubon-duponey :) As usual thank you for the detailed feedback, it is very appreciated.
image:
couldn't find a way to #Pull an image for a specific platform
It's planned but not yet implemented.
where to pass secrets that are used inside a Dockerfile on #Dockerfile (eg: RUN --mount=type=secret) - more generally, how do you pass mounts to #Dockerfile?
If you don't see it, it's probably not implemented. But if it's a pass-through to buildkit or its dockerfile frontend, it's pretty easy to add. Perhaps a PR? 😇
how to specify cache_to, cache_from on #Dockerfile
I'm guessing that's a client-side flag of the docker command-line? This one will probably require more design discussion.
platforms is here on #Dockerfile but I do not understand how that would work (or for #Push for that matter) - then looking at Multi-platform in Europa #1371 makes me wonder if it's implemented at all? Maybe it's not part of the Europa milestone then (it would very likely impact the CUE API right?)
Yes correct, we want to implement it very much, but it's a beast of a design, we want to get it right, and had to prioritize to get 0.2 out. It's a high priority for 0.2.x
at some point there was code to start containers on remote docker hosts (based on a wrapper around docker cli IIRC) - looks like #Run is now purely based on #Exec which doesn't seem to allow that anymore - maybe I missed something? or was the previous component removed from universe?
It was removed from universe but we plan on adding it back, possibly under universe.dagger.io/docker/client. We've deprioritized it in favor of implementing Docker features directly on top of buildkit. This will be better experience for 90% of developpers. Assuming you're in the remaining 10%, maybe we can collaborate on getting docker/client in as soon as possible :)
#Run seems to be missing a number of useful features (devices, group_add, caps, network, ...)
If buildkit supports it, we can easily add it to dagger.#Exec and from there, to docker.#Run. If it's a feature specific to Docker engine, which buildkit has no equivalent for, then it will have to wait for docker/client and we will gladly collaborate with you to get it in.
I don't have a precise idea, but my brain started pattern-matching in the background, based on various inputs:
The need to wrap a low-level command into a higher-level command. For example aws.#CLI that wants to expose subcommands of the aws command as if they were top-level commands.
Combining multiple commands in the same container, or independently of a specific container, is not possible. For example bash.#Run (command spec where you can bring your own container) is very useful, but what if I want the same thing with several commands? I have no choice but to merge then into a shell script for example.
You can't manipulate a docker command without running it.
docker.#Run and docker.#Image have a lot of similar fields, but they are completely different schemas. That feels like it could be improved in some way. Perhaps even the distinction between "image" and "container" the way they are defined in the docker engine, is becoming obsolete? For example there are several projects that argue that the "image" as a static artifact is not important, an implementation detail. You specify what you want to run, and it is assembled and run for you, on demand. See for example the "nixery" registry, a project by @fermayo the name of which eludes me right now, and more recently blog posts by the apko/alpine maintainer.
It's not just docker that needs a concept of command. Maybe we can define a portable abstraction for a command, and reuse it across implementations. For example there is the client.command schema which is very similar to docker.#Run but not quite. I'm sure ssh will need one as well; etc.
In a way, you could see a docker image 1) a rootfs + 2) a default command + 3) optionally an entrypoint command
Like I said - just pattern matching at this stage.
Activity
helderco commentedon Feb 23, 2022
shykes commentedon Feb 24, 2022
Thanks, I added those to the list.
Yes, I agree the new
dockeris important enough to deserve its own "last call" issue. I will create a placeholder and link to it from here.dubo-dubon-duponey commentedon Feb 25, 2022
Super exciting to see 0.2 coming along ❤️
Just took a brief look at the source - here are some quick comments (hope I did not misunderstand something obvious).
image:#Pullan image for a specific platform#Dockerfile(eg:RUN --mount=type=secret) - more generally, how do you passmountsto#Dockerfile?cache_to,cache_fromon#Dockerfileplatformsis here on#Dockerfilebut I do not understand how that would work (or for#Pushfor that matter) - then looking at Multi-platform containers #1371 makes me wonder if it's implemented at all? Maybe it's not part of the Europa milestone then (it would very likely impact the CUE API right?)docker:#Runis now purely based on#Execwhich doesn't seem to allow that anymore - maybe I missed something? or was the previous component removed from universe?#Runseems to be missing a number of useful features (devices, group_add, caps, network, ...)Random other:
#WriteFile(and probably#MkDir) may not be working as intended (Permissions on file creation does not work as expected when a umask has been set #1640) - a fix may change the behaviorshykes commentedon Feb 25, 2022
Good to see you back in the neighborhood @dubo-dubon-duponey :) As usual thank you for the detailed feedback, it is very appreciated.
It's planned but not yet implemented.
If you don't see it, it's probably not implemented. But if it's a pass-through to buildkit or its dockerfile frontend, it's pretty easy to add. Perhaps a PR? 😇
I'm guessing that's a client-side flag of the
dockercommand-line? This one will probably require more design discussion.Yes correct, we want to implement it very much, but it's a beast of a design, we want to get it right, and had to prioritize to get 0.2 out. It's a high priority for 0.2.x
It was removed from universe but we plan on adding it back, possibly under
universe.dagger.io/docker/client. We've deprioritized it in favor of implementing Docker features directly on top of buildkit. This will be better experience for 90% of developpers. Assuming you're in the remaining 10%, maybe we can collaborate on gettingdocker/clientin as soon as possible :)If buildkit supports it, we can easily add it to
dagger.#Execand from there, todocker.#Run. If it's a feature specific to Docker engine, which buildkit has no equivalent for, then it will have to wait fordocker/clientand we will gladly collaborate with you to get it in.Thanks for filing!
helderco commentedon Mar 24, 2022
@shykes, you mentioned a redesign for
docker.#Runcommand composition in:docker.#Runoptional #1749 (comment)docker.#Run#1808 (review)Do you have any ideas on that?
shykes commentedon Mar 24, 2022
I don't have a precise idea, but my brain started pattern-matching in the background, based on various inputs:
aws.#CLIthat wants to expose subcommands of theawscommand as if they were top-level commands.bash.#Run(command spec where you can bring your own container) is very useful, but what if I want the same thing with several commands? I have no choice but to merge then into a shell script for example.docker.#Runanddocker.#Imagehave a lot of similar fields, but they are completely different schemas. That feels like it could be improved in some way. Perhaps even the distinction between "image" and "container" the way they are defined in the docker engine, is becoming obsolete? For example there are several projects that argue that the "image" as a static artifact is not important, an implementation detail. You specify what you want to run, and it is assembled and run for you, on demand. See for example the "nixery" registry, a project by @fermayo the name of which eludes me right now, and more recently blog posts by the apko/alpine maintainer.client.commandschema which is very similar todocker.#Runbut not quite. I'm suresshwill need one as well; etc.Like I said - just pattern matching at this stage.
fermayo commentedon Mar 24, 2022
ctr.run (currently shut down)
shykes commentedon Mar 24, 2022
Thanks :) And hi!