Skip to content

Allow building a Dockerfile (instead of a directory) and using docker buildx build explicitly#14

Draft
tianon wants to merge 2 commits into
infosiftr:masterfrom
tianon:build
Draft

Allow building a Dockerfile (instead of a directory) and using docker buildx build explicitly#14
tianon wants to merge 2 commits into
infosiftr:masterfrom
tianon:build

Conversation

@tianon

@tianon tianon commented Jan 28, 2025

Copy link
Copy Markdown
Member

Add support for --build=Dockerfile

The --build flag currently supports a directory to build - this adds support for specifying a file instead (thus with no directory context).

This also suppots Bash's "process substitution" such that something like the following is doable (to inline a Dockerfile to build):

hocker_run --build <(printf 'FROM ...\nRUN ...\n') ...

Allow --buildx as an alternate to --build

This will build with docker buildx build explicitly.

The `--build` flag currently supports a directory to build - this adds support for specifying a file instead (thus with no directory context).

This *also* suppots Bash's "process substitution" such that something like the following is doable (to inline a `Dockerfile` to build):

    hocker_run --build <(printf 'FROM ...\nRUN ...\n') ...
This will build with `docker buildx build` explicitly.
@tianon tianon marked this pull request as draft January 28, 2025 06:57
@tianon

tianon commented Jan 28, 2025

Copy link
Copy Markdown
Member Author

Most of this (all the Dockerfile stuff) is code I've been using happily on one of my personal systems for a really long time now.

However, the buildx stuff is brand new and I've realized it's actually wrong thanks to buildx not necessarily using images from docker pull (so us doing the pulling isn't necessarily right). 🙃

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

Successfully merging this pull request may close these issues.

1 participant