Skip to content

Commit 9f20cbe

Browse files
committed
Use schema vars properly
1 parent 0bf8de5 commit 9f20cbe

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

constructor/_schema.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,12 +863,14 @@ class ConstructorConfiguration(BaseModel):
863863
"""
864864
docker_tag: NonEmptyStr | None = None
865865
"""
866-
Tag to use for the built docker image when `installer_type` includes `docker`.
866+
Tag to use for the built docker image.
867867
If not provided, it will default to `<name>:<version>`.
868868
"""
869869
docker_labels: dict[NonEmptyStr, NonEmptyStr] = {}
870870
"""
871-
Labels to add to the built docker image when `installer_type` includes `docker`.
871+
Additional labels to add to the built docker image.
872+
The labels `org.opencontainers.image.title` and `org.opencontainers.image.version` are
873+
set automatically from `name` and `version`.
872874
"""
873875

874876

constructor/docker_build.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def generate_dockerfile(info: dict, docker_dir: Path) -> Path:
9191
rendered_dockerfile = docker_template.render(
9292
constructor_version=__version__,
9393
base_image=docker_base_image,
94-
default_prefix=info.get("default_prefix", f"/opt/{info.get('installer_name').lower()}"),
94+
default_prefix=info.get("default_prefix", f"/opt/{info['name'].lower()}"),
9595
installer_filename=Path(info["_outpath"]).name,
9696
clean_cmd="$PREFIX/bin/mamba clean -afy"
9797
if "mamba" in specs
@@ -147,9 +147,7 @@ def build_image(info: dict, docker_dir: Path) -> None:
147147
"Supported platforms are: {', '.join(DOCKER_PLATFORM_MAP)}."
148148
)
149149

150-
image_name = info.get("docker_image_name", info["name"].lower())
151-
image_version = info.get("docker_image_version", info["version"].split("-")[0])
152-
tag = f"{image_name}:{image_version}"
150+
tag = info.get("docker_tag", f"{info['name']}:{info['version'].split('-')[0]}")
153151

154152
cmd = [
155153
"docker",

0 commit comments

Comments
 (0)