Skip to content

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

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tianon
Copy link
Member

@tianon tianon commented Jan 28, 2025

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
Copy link
Member Author

tianon commented Jan 28, 2025

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