I have done the following
Steps to reproduce
Dockerfile:
ARG PYTHON_IMAGE="python:3.13-slim"
FROM ${PYTHON_IMAGE} AS builder
First build it without explicitly passing this value, then try building by explicitly passing it as a build arg.
Example using the container CLI:
container build
container build --build-arg PYTHON_IMAGE="python:3.13-slim"
Current behavior
The first command fails because the default value is not used to fill in the arg when you don't supply it. The second command works as expected.
container build
[+] Building 0.0s (0/0)
Error: unknown (2): failed to solve: invalid ref: ${PYTHON_IMAGE}
Note that this does work as expected when building with alternatives like Docker and Rancher (= Lima under the hood).
Expected behavior
The first command also works, by using the supplied default value from the Dockerfile.
Environment
- OS: macOS 26.3.1
- Xcode: Version 26.3
- Container: container CLI version 0.10.0 (build: release, commit: 6bdb647)
Relevant log output
Code of Conduct
I have done the following
Steps to reproduce
Dockerfile:
First build it without explicitly passing this value, then try building by explicitly passing it as a build arg.
Example using the
containerCLI:container build container build --build-arg PYTHON_IMAGE="python:3.13-slim"Current behavior
The first command fails because the default value is not used to fill in the arg when you don't supply it. The second command works as expected.
container build [+] Building 0.0s (0/0) Error: unknown (2): failed to solve: invalid ref: ${PYTHON_IMAGE}Note that this does work as expected when building with alternatives like Docker and Rancher (= Lima under the hood).
Expected behavior
The first command also works, by using the supplied default value from the Dockerfile.
Environment
Relevant log output
Code of Conduct