From eb037d02fc3c5a342c3b942077d97859d92bb933 Mon Sep 17 00:00:00 2001
From: Techassi <sascha.lautenschlaeger@stackable.tech>
Date: Fri, 11 Oct 2024 12:44:28 +0200
Subject: [PATCH 1/4] chore: Migrate pre-commit config

---
 .pre-commit-config.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 3f4684c..5938cc5 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -63,4 +63,4 @@ repos:
         language: python
         'types': [python]
         pass_filenames: false
-        stages: [commit]
+        stages: [pre-commit]

From c1977b2d5794a11e8d5fb9ce17f4255641448ff6 Mon Sep 17 00:00:00 2001
From: Techassi <sascha.lautenschlaeger@stackable.tech>
Date: Fri, 11 Oct 2024 12:44:53 +0200
Subject: [PATCH 2/4] feat: Add --target-containerfile argument

---
 src/image_tools/args.py | 7 +++++++
 src/image_tools/bake.py | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/image_tools/args.py b/src/image_tools/args.py
index 12be59f..7cd3bc9 100644
--- a/src/image_tools/args.py
+++ b/src/image_tools/args.py
@@ -90,6 +90,12 @@ def bake_args() -> Namespace:
         type=check_build_arg,
     )
 
+    parser.add_argument(
+        "--target-containerfile",
+        help="Override the target containerfile used, points to <PRODUCT>/<TARGET_CONTAINERFILE>. Default: Dockerfile",
+        default="Dockerfile",
+    )
+
     result = parser.parse_args()
 
     if result.shard_index >= result.shard_count:
@@ -239,6 +245,7 @@ def load_configuration(conf_file_name: str, cli_build_args: List[Tuple[str, str]
             return module
     raise ImportError(name=module_name, path=conf_file_name)
 
+
 def assemble_final_build_args(conf: ModuleType, cli_build_args: List[Tuple[str, str]] = []) -> None:
     cli_build_args = cli_build_args or []
     # Convert user_build_args to a dictionary with lowercase keys for easier, case-insensitive lookup
diff --git a/src/image_tools/bake.py b/src/image_tools/bake.py
index d7f560d..d0436f9 100644
--- a/src/image_tools/bake.py
+++ b/src/image_tools/bake.py
@@ -122,7 +122,7 @@ def bakefile_product_version_targets(
                 "build-date": rfc3339_date_time,
                 "org.opencontainers.image.revision": revision,
             },
-            "dockerfile": f"{product_name}/Dockerfile",
+            "dockerfile": f"{product_name}/{args.target_containerfile}",
             "tags": tags,
             "args": build_args,
             "platforms": [args.architecture],

From b600998d26b82ae5434451220a0dd59804404e9c Mon Sep 17 00:00:00 2001
From: Techassi <sascha.lautenschlaeger@stackable.tech>
Date: Fri, 11 Oct 2024 12:52:21 +0200
Subject: [PATCH 3/4] chore: Add changelog entry

---
 CHANGELOG.md | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c49ec1e..019bf5d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
 
 ## [Unreleased]
 
+## Added
+
+- Add `--target-containerfile` argument to override the default `Dockerfile` value ([#44]).
+
+[#44]: https://github.com/stackabletech/image-tools/pull/44
+
 ## 0.0.13 - 2024-09-06
 
 ### Added

From cec97e9699b185e1477dab1ddda206000d998064 Mon Sep 17 00:00:00 2001
From: Techassi <sascha.lautenschlaeger@stackable.tech>
Date: Fri, 11 Oct 2024 12:55:26 +0200
Subject: [PATCH 4/4] chore: Fix changelog

---
 CHANGELOG.md | 43 +++++++++++++++++++++++--------------------
 1 file changed, 23 insertions(+), 20 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 019bf5d..90bb0fa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,11 +14,12 @@ All notable changes to this project will be documented in this file.
 
 ### Added
 
-- `conf.py` now can contain a `args` dict, which contains arguments available to all products, they can be overridden by product specific or CLI arguments ([#41])
+- `conf.py` now can contain a `args` dict, which contains arguments available to all products, they
+  can be overridden by product specific or CLI arguments ([#41]).
 
 ### Fixed
 
-- `--build-arg` was not case-insensitive as claimed in the docs, this has been  fixed ([#41])
+- `--build-arg` was not case-insensitive as claimed in the docs, this has been  fixed ([#41]).
 
 [#41]: https://github.com/stackabletech/image-tools/pull/41
 
@@ -26,11 +27,11 @@ All notable changes to this project will be documented in this file.
 
 ### Added
 
-- New `bake` command line argument `--build-arg` to override conf.py build arguments ([#38])
+- New `bake` command line argument `--build-arg` to override conf.py build arguments ([#38]).
 
 ### Fixed
 
-- check-container: fix regression introduced by 0.0.9. Add dummy cache property ([#39])
+- check-container: fix regression introduced by 0.0.9. Add dummy cache property ([#39]).
 
 [#38]: https://github.com/stackabletech/image-tools/pull/38
 [#39]: https://github.com/stackabletech/image-tools/pull/39
@@ -39,7 +40,7 @@ All notable changes to this project will be documented in this file.
 
 ### Added
 
-- Automatically create labels and annotations recording the git revision and build time ([#34])
+- Automatically create labels and annotations recording the git revision and build time ([#34]).
 
 [#34]: https://github.com/stackabletech/image-tools/pull/34
 
@@ -47,8 +48,8 @@ All notable changes to this project will be documented in this file.
 
 ### Fixed
 
-- Add architecture identifier to the build cache backend ref name ([#31])
-- Backwards compat: don't assume conf.cache exists ([#32])
+- Add architecture identifier to the build cache backend ref name ([#31]).
+- Backwards compat: don't assume conf.cache exists ([#32]).
 
 [#31]: https://github.com/stackabletech/image-tools/pull/31
 [#32]: https://github.com/stackabletech/image-tools/pull/32
@@ -57,7 +58,8 @@ All notable changes to this project will be documented in this file.
 
 ### Added
 
-- New command line arg to `bake`: `--cache`. Requires cache backend configuration in conf.py ([#29])
+- New command line arg to `bake`: `--cache`. Requires cache backend configuration in
+  `conf.py` ([#29]).
 
 [#29]: https://github.com/stackabletech/image-tools/pull/29
 
@@ -65,13 +67,13 @@ All notable changes to this project will be documented in this file.
 
 ### Added
 
-- New command line arg to `bake`: `--version`. Also switch to relative imports. ([#17])
-- Raise lint dependency versions ([#17])
-- Drop support for python 3.10 and add explicit support for 3.12 ([#17])
+- New command line arg to `bake`: `--version`. Also switch to relative imports ([#17]).
+- Raise lint dependency versions ([#17]).
+- Drop support for python 3.10 and add explicit support for 3.12 ([#17]).
 
 ### Fixed
 
-- Use cwd in module path so imports in conf.py work ([#27])
+- Use cwd in module path so imports in `conf.py` work ([#27]).
 
 [#17]: https://github.com/stackabletech/image-tools/pull/17
 [#27]: https://github.com/stackabletech/image-tools/pull/27
@@ -80,7 +82,8 @@ All notable changes to this project will be documented in this file.
 
 ### Fixed
 
-- Invalid 'buildx bake' configuration file generated due to architecture not being a list anymore. ([#13])
+- Invalid 'buildx bake' configuration file generated due to architecture not being a list
+  anymore ([#13]).
 
 [#13]: https://github.com/stackabletech/image-tools/pull/13
 
@@ -88,7 +91,7 @@ All notable changes to this project will be documented in this file.
 
 ### Changed
 
-- Add platform argument for preflight checks ([#12])
+- Add platform argument for preflight checks ([#12]).
 
 [#12]: https://github.com/stackabletech/image-tools/pull/12
 
@@ -96,7 +99,7 @@ All notable changes to this project will be documented in this file.
 
 ### Changed
 
-- Relax schema for image tags ([#7])
+- Relax schema for image tags ([#7]).
 
 [#7]: https://github.com/stackabletech/image-tools/pull/7
 
@@ -104,11 +107,11 @@ All notable changes to this project will be documented in this file.
 
 ### Added
 
-- New `bake` argument (`--export-tags-file`) to write target tags to text file ([#4])
+- New `bake` argument (`--export-tags-file`) to write target tags to text file ([#4]).
 
 ### Changed
 
-- Changed `conf` schema to drop support for versions as strings. Only dicts are supported ([#4])
+- Changed `conf` schema to drop support for versions as strings. Only dicts are supported ([#4]).
 
 [#4]: https://github.com/stackabletech/image-tools/pull/4
 
@@ -116,11 +119,11 @@ All notable changes to this project will be documented in this file.
 
 ### Added
 
-- Allow `bake` product names to accept a version as suffix separated by "=" ([#2])
-- New `bake` command line options `--shard-index` and `--shard-count` ([#2])
+- Allow `bake` product names to accept a version as suffix separated by "=" ([#2]).
+- New `bake` command line options `--shard-index` and `--shard-count` ([#2]).
 
 ### Changed
 
-- Make stackable image version (`-i`) for `bake` optional and default to `0.0.0-dev` ([#2])
+- Make stackable image version (`-i`) for `bake` optional and default to `0.0.0-dev` ([#2]).
 
 [#2]: https://github.com/stackabletech/image-tools/pull/2
