dalec icon indicating copy to clipboard operation
dalec copied to clipboard

[REQ] ability to create containers without creating a spec

Open sozercan opened this issue 10 months ago • 4 comments

What kind of request is this?

New feature

What is your request or suggestion?

I would like Dalec to be able to create containers from pre-existing runtime dependencies without users having to create a yaml file (similar to https://sozercan.github.io/aikit/docs/create-images#quick-start)

example: docker buildx build -t oras-jq:latest --load --build-arg="dependencies.runtime=oras,jq" --target azlinux3 ...

This is useful if someone wants to create a minimal container with existing runtime dependencies immediately without hassle of learning how to create and maintain a spec

Are you willing to submit PRs to contribute to this feature request?

  • [ ] Yes, I am willing to implement it.

sozercan avatar Feb 14 '25 18:02 sozercan

You always have to provide docker with a file to build. This can be provided from stdin, though. This works today:

docker buildx build --build-arg BUILDKIT_SYNTAX=ghcr.io/azure/dalec/frontend:latest --target=mariner2/container/depsonly -<<<"$(jq -c '.dependencies.runtime += {"jq": {}}' <<<"{}" )"

cpuguy83 avatar Feb 14 '25 18:02 cpuguy83

I realize we never added tests for depsonly and is currently broken on azlinux3, though.

cpuguy83 avatar Feb 14 '25 18:02 cpuguy83

I believe I fixed depsonly for azlinux (and ideally any other RPM distros?) in #493!

adamperlin avatar Feb 14 '25 18:02 adamperlin

Ok looking at this again and there is currently a bug with depsonly that I am looking into! The intent was to fix that target

update: may or not be a bug, basically depsonly fails in a confusing place if there are no runtime deps in the spec to install. Error handling there could be improved. Otherwise, seems to be working!

adamperlin avatar Feb 14 '25 18:02 adamperlin

@cpuguy83 can we close this?

sozercan avatar Dec 02 '25 17:12 sozercan