Skip to content

[Bug]: "Error: unknown (2): failed to solve: no build directives" on environment-only container-file build (0.5.0) #736

@srcshelton

Description

@srcshelton

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

The container-file at https://github.com/srcshelton/docker-gentoo-build/blob/master/gentoo-base/Dockerfile.env exists solely of ENV declarations to be inherited by downstream container-images. Attempting to container build it results in:

$ /usr/local/bin/container build --file Dockerfile.env --tag localhost/gentoo-env:latest . 
Error: unknown (2): failed to solve: no build directives

It should be possible to produce an image from a Container-file which consists only of ENV (and ARG) keywords.

Current behavior

Container-files which only perform environment-setup cannot be built.

Expected behavior

Container-files which only perform environment-setup are valid and so should produce a container-image when built.

Environment

- OS: macOS 26.0.1
- Xcode: Version 26.0.1 (17A400)
- Container: container CLI version 0.5.0 (build: release, commit: 48230f3)

Relevant log output

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    builderIssues and features associated with container image buildingnextItems in scope for the next few milestones

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions