Skip to content

nerdctl compose does not support dockerfile_inline #4108

Closed

Description

@mook-as

What is the problem you're trying to solve

The compose specification contains a dockerfile_inline feature that is used instead of an external dockerfile. Currently this is not supported in nerdctl.

Describe the solution you'd like

Added support for the feature.

Additional context

Given the compose.yaml:

services:
  foo:
    build:
      dockerfile_inline: |
        FROM scratch

nerdctl compose build says:

WARN[0000] Ignoring: build: [DockerfileInline]          
INFO[0000] Building image a-foo                         
FATA[0000] lstat /a/Containerfile: no such file or directory 
FATA[0000] error while building image a-foo: exit status 1 
Error: exit status 1

nerdctl version 2.0.4

Activity

  1. tushar5526 commented on Apr 26, 2025

    @tushar5526
    Contributor

    I can try it if no one is already working on it.

  2. AkihiroSuda commented on Apr 29, 2025

    @AkihiroSuda
    Member

    I can try it if no one is already working on it.

    Thanks

  3. tushar5526 commented on May 3, 2025

    @tushar5526
    Contributor

    @AkihiroSuda, we use nerdctl build behind the scenes to build the image and assume that a Dockerfile or a Containerfile would be in the project path.

    Is there any preferred approach to implement this one? I was thinking of writing the dockerfile_inline to a tmp directory and then running a nerdctl build -t <tag> -f /tmp/<random-dir>/Dockerfile <project-path> for it.

    I also thought of specifying the Dockerfile contents directly via stdin https://docs.docker.com/build/concepts/context/#local-context-with-dockerfile-from-stdin - but it seems nerdctl does not implement this functionality.

  4. AkihiroSuda commented on May 3, 2025

    @AkihiroSuda
    Member

    SGTM

  5. apostasie commented on May 17, 2025

    @apostasie
    Contributor

    @tushar5526 still interested in implementing this?

  6. tushar5526 commented on May 20, 2025

    @tushar5526
    Contributor

    @apostasie ahh sorry I have been travelling for the past few weeks. I still plan to do it over weekends, but if you are interested you can take over, :) I will try finding something else.

  7. apostasie commented on May 20, 2025

    @apostasie
    Contributor

    Cool!
    Go for it @tushar5526 all yours

  8. tushar5526 commented on Jun 4, 2025

    @tushar5526
    Contributor

    Started a draft PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions