Fails with `# syntax=devthefuture-org/dockerfile-x`

Open
#991 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
docker, typescript

Research direction

Start by reproducing the failure with devcontainer build --workspace-folder . using .devcontainer/Dockerfile and .devcontainer/fork.Dockerfile, then trace how the CLI handles the local FROM ./Dockerfile input. Done means this Dockerfile syntax is accepted without being validated as an image reference, while existing Docker builds continue to work.

Written by the indexing model from the issue text.

Description

Hi there,

In my case, I fork an open source project which defines its own devcontainer Dockerfile.

However, I need to make changes to it. If I make my changes directly in the Dockerfile, every time I pull from this upstream repository I will have merge conflicts to resolve.

I wanted to use https://github.com/devthefuture-org/dockerfile-x#from to avoid this.

Here's how it works:

  • .devcontainer/Dockerfile
FROM ubuntu
  • .devcontainer/fork.Dockerfile
# syntax = devthefuture/dockerfile-x

FROM ./Dockerfile

RUN echo add my customizations

And it works great when using Docker CLI with docker build .devcontainer -f .devcontainer/fork.Dockerfile.

But devcontainer build fails with:

❯ devcontainer build --workspace-folder .
[14 ms] @devcontainers/cli 0.75.0. Node.js v22.14.0. linux 6.8.0-52-generic x64.
[351 ms] Path './dockerfile' for input 'docker.io/./dockerfile' failed validation.  Expected path to match regex '/^[a-z0-9]+([._-][a-z0-9]+)*(\/[a-z0-9]+([._-][a-z0-9]+)*)*$/'.
invalid reference format: repository name (Dockerfile) must be lowercase
{"outcome":"error","message":"Command failed: docker inspect --type image ./Dockerfile","description":"An error occurred building the container."}

Can you please alleviate this check to support this use case? I would be very grateful.

Dominant language
TypeScript
Stars
3k
Forks
461
Avg merge
18m
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from devcontainers/cli

All issues in devcontainers/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.