You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix build error with --build-template conda/micromamba:v2 for singularity (#972)
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Copy file name to clipboardExpand all lines: docs/api.md
+8-12Lines changed: 8 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -218,12 +218,12 @@ Returns the name of the container request made available by Wave.
218
218
|`mambaImage`| Name of the Docker image used to build Conda containers. |
219
219
|`commands`| Command to be included in the container. |
220
220
|`basePackages`| Names of base packages. |
221
-
|`baseImage`| Base image for the final stage of multi-stage Conda/Pixi builds. |
221
+
|`baseImage`| Base image for the final stage of multi-stage Conda/Pixi Docker builds. Has no effect on Singularity builds.|
222
222
|`pixiOpts`| Pixi build options (when `type` is `CONDA` and `buildTemplate` is `conda/pixi:v1`). |
223
223
|`pixiImage`| Name of the Docker image used for Pixi package manager (e.g., `ghcr.io/prefix-dev/pixi:latest`). |
224
224
|`cranOpts`| CRAN build options (when `type` is `CRAN`). |
225
225
|`rImage`| Name of the R Docker image used to build CRAN containers (e.g., `rocker/r-ver:4.4.1`). |
226
-
|`buildTemplate`| The build template to use for container builds. Supported values: `conda/pixi:v1` (Pixi with multi-stage builds), `conda/micromamba:v2` (Micromamba 2.x with multi-stage builds). Default: `conda/micromamba:v1` template. |
226
+
|`buildTemplate`| The build template to use for container builds. Supported values: `conda/pixi:v1` (multi-stage build using Pixi), `conda/micromamba:v2` (multi-stage build using Micromamba 2.x). Both produce smaller images by excluding the package manager from the final stage (Singularity still uses a single-stage build). Default: `conda/micromamba:v1`. |
227
227
|`nameStrategy`| The name strategy to be used to create the name of the container built by Wave. Options: `none`, `tagPrefix`, `imageSuffix`. ||
228
228
229
229
#### Response
@@ -493,7 +493,7 @@ Get status of build against `buildId` passed as path variable
493
493
}
494
494
```
495
495
496
-
- Create Singularity image with Pixi v1 template (multi-stage build):
496
+
- Create Singularity image with Pixi v1 template (single-stage build):
497
497
498
498
**Request**
499
499
@@ -535,7 +535,7 @@ Get status of build against `buildId` passed as path variable
535
535
}
536
536
```
537
537
538
-
- Create Singularity image with Micromamba v2 template (multi-stage build):
538
+
- Create Singularity image with Micromamba v2 template (single-stage build):
539
539
540
540
**Request**
541
541
@@ -578,19 +578,15 @@ Get status of build against `buildId` passed as path variable
578
578
```
579
579
580
580
:::note
581
-
Multi-stage build templates (`conda/pixi:v1` and `conda/micromamba:v2`) create optimized container images by separating the build environment from the final runtime environment. This results in smaller container images that only contain the installed packages and runtime dependencies, without the build tools.
581
+
Multi-stage build templates (`conda/pixi:v1` and `conda/micromamba:v2`) create optimized Docker container images by separating the build environment from the final runtime environment. This results in smaller container images that only contain the installed packages and runtime dependencies, without the build tools.
582
582
:::
583
583
584
584
:::important
585
-
**Image Requirements forSingularity Builds with Pixi and Micromamba v2 Templates**
585
+
**Singularity builds use single-stage**
586
586
587
-
When building Singularity images (`format: "sif"`) with the `conda/pixi:v1` or `conda/micromamba:v2` build templates, base images (via `baseImage` option) must have the `tar` utility installed.
587
+
When building Singularity images (`format: "sif"`) with the `conda/pixi:v1` or `conda/micromamba:v2` build templates, single-stage builds are used. Singularity's proot-based builder cannot preserve file permissions when transferring files across stages, so the conda/pixi environment is installed directly in a single stage using the mamba/pixi image as the base.
588
588
589
-
This requirement exists because Singularity's multi-stage builds use `proot` to emulate filesystem operations, which cannot reliably copy directory structures between build stages. The templates support this by compressing the environment into a tarball (`tar czf`) and extracting it (`tar xzf`) in the final stage.
590
-
591
-
Docker builds are not affected by this requirement. Docker's native `COPY --from=build` directive handles directory copying directly.
592
-
593
-
Most standard base images (Ubuntu, Debian, Alpine, etc.) include `tar` by default, but minimal or distroless images may require explicit installation.
589
+
As a result, the `baseImage` option has no effect on Singularity builds — it only applies to Docker builds. The multi-stage image size optimization is also not available for Singularity.
|`conda/micromamba:v1`| Single-stage build using Micromamba v1 (default). The final image includes the package manager. |
96
-
|`conda/micromamba:v2`| Multi-stage build using Micromamba 2.x. Produces smaller images without the package manager in the final stage. |
97
-
|`conda/pixi:v1`| Multi-stage build using [Pixi][pixi] package manager. Produces smaller images with faster dependency resolution. |
96
+
|`conda/micromamba:v2`| Multi-stage build using Micromamba 2.x. Produces smaller images by excluding the package manager from the final stage (Singularity still uses a single-stage build).|
97
+
|`conda/pixi:v1`| Multi-stage build using [Pixi][pixi] package manager. Produces smaller images with faster dependency resolution (Singularity still uses a single-stage build). |
98
98
99
99
**Related CLI arguments**
100
100
@@ -110,11 +110,11 @@ Multi-stage build templates offer several advantages:
110
110
- **Reproducibility**: Lock files are generated for exact package version tracking.
111
111
- **Security**: Fewer binaries in the final image reduces the attack surface.
112
112
113
-
**Singularity build requirements**
113
+
**Singularity builds use single-stage**
114
114
115
-
When building Singularity containers (`--singularity`) with the `conda/micromamba:v2` or `conda/pixi:v1` templates, base images must have the `tar` utility installed. This is required because Singularity's multi-stage builds use `proot`, which cannot copy directory structures directly between build stages. The templates work around this by compressing the environment with `tar` and extracting it in the final stage.
115
+
When building Singularity containers (`--singularity`) with the `conda/micromamba:v2` or `conda/pixi:v1` templates, single-stage builds are used. Singularity's proot-based builder cannot preserve file permissions when transferring files across stages, so the conda/pixi environment is installed directly in a single stage using the mamba/pixi image as the base.
116
116
117
-
Docker builds are not affected by this requirement.
117
+
As a result, the `baseImage` option has no effect on Singularity builds — it only applies to Docker builds. The multi-stage image size optimization is also not available for Singularity.
118
118
119
119
**Example usage**
120
120
@@ -126,7 +126,7 @@ wave \
126
126
--build-template conda/pixi:v1
127
127
```
128
128
129
-
Build a container using the Micromamba v2 multi-stage template:
129
+
Build a container using the Micromamba v2 template:
0 commit comments