Skip to content

Commit

Permalink
PR #1717: add extension .df for image name inference
Browse files Browse the repository at this point in the history
  • Loading branch information
reidpr committed Sep 5, 2023
1 parent 707f560 commit 5671de0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions doc/ch-image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,9 @@ Options:
extension with invalid characters stripped, e.g.
:code:`Dockerfile.@FOO.bar` → :code:`foo.bar`.

2. If Dockerfile has extension :code:`dockerfile`: use the basename with
the same transformation, e.g. :code:`baz.@QUX.dockerfile` ->
:code:`baz.qux`.
2. If Dockerfile has extension :code:`df` or :code:`dockerfile`: use the
basename with the same transformation, e.g. :code:`baz.@QUX.dockerfile`
-> :code:`baz.qux`.

3. If context directory is not :code:`/`: use its name, i.e. the last
component of the absolute path to the context directory, with the same
Expand Down
2 changes: 1 addition & 1 deletion lib/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def main(cli_):
if (base == "Dockerfile"):
cli.tag = ext_all
ch.VERBOSE("inferring name from Dockerfile extension: %s" % cli.tag)
elif (ext_last == "dockerfile"):
elif (ext_last in ("df", "dockerfile")):
cli.tag = base_all
ch.VERBOSE("inferring name from Dockerfile basename: %s" % cli.tag)
elif (os.path.abspath(cli.context) != "/"):
Expand Down

0 comments on commit 5671de0

Please sign in to comment.