buildah
buildah copied to clipboard
Feature request: Support buildah shell scripts as custom syntax for `DOCKER_BUILDKIT=1 docker build`.
Recent versions of Docker support alternate syntaxes / front-ends for the docker build command when BuildKit is enabled:
https://docs.docker.com/engine/reference/builder/#syntax
E.g., Given a file such as:
lighthttpd.buildahkit
# syntax = containers/buildahkit
ctr1=$(buildah from "${1:-fedora}")
## Get all updates and install our minimal httpd server
buildah run "$ctr1" -- dnf update -y
buildah run "$ctr1" -- dnf install -y lighttpd
## Include some buildtime annotations
buildah config --annotation "com.example.build.host=$(uname -n)" "$ctr1"
## Run our server and expose the port
buildah config --cmd "/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf" "$ctr1"
buildah config --port 80 "$ctr1"
## Commit this container to an image name
buildah commit "$ctr1" "${2:-$USER/lighttpd}"
...it could be built using Docker running on Linux, Mac, Windows, etc. using a command like the following:
DOCKER_BUILDKIT=1 docker build -f lighthttpd.buildahkit .
If I understand correctly, it seems like this can be accomplished by providing a mapping of buildah commands to Low-Level Builder (LLB) format that can be understood by a buildkit backend. Publishing the mapping as an image to Docker Hub would enable the usage publicly. More info: https://github.com/moby/buildkit#exploring-llb
It seems like this would be a good way to help people transition from Docker.
@flouthoc @nl-brett-stime I am not sure what the request here is?
@rhatdan : The request is to provide a gateway into the world of Buildah via Docker BuildKit and their support for alternate syntaxes in their build declaration files . It'll take some knowledge of both Buildah and BuildKit to pull it off but I think it'll benefit Buildah more than BuildKit e.g., making it easy to get started with Buildah from Mac and Windows.
A friendly reminder that this issue had no activity for 30 days.
@flouthoc PTAL Looks like Buildkit supports builtin arg passing for $1 and $2?
@rhatdan I think @nl-brett-stime is trying to create a buildah specific syntax for buildkit. @nl-brett-stime Please correct me if i am wrong.
I think end result expectation from this issue is.
- Buildkit to be able to read a valid
.buildahkitfile and actual build is performed via buildkit. So there is a inter-op between buildkit and buildah-cli commands.
A friendly reminder that this issue had no activity for 30 days.
@nl-brett-stime Any inputs on the comment above ? If my assumption is correct https://github.com/containers/buildah/issues/3497#issuecomment-968707184 I believe following issue should be opened against the buildkit/moby repo as well.
A friendly reminder that this issue had no activity for 30 days.
Since we never heard back, I am closing.