Skip to content

[BUG] dockerfile_inline no longer supports ARG #13269

@alexleach

Description

@alexleach

Description

Some of my existing compose.yaml files have recently stopped working, with respect to using build.args and build.dockerfile_inline together.

An ARG is no longer expanded within the dockerfile_inline block.

Current Behaviour

Here is a minimal non-working example of a compose.yaml file:

services:
  hello:
    build:
      context: .

      args:
        ARCH: "x86_64"

      dockerfile_inline: |
        FROM alpine:latest
        ARG ARCH
        RUN wget "https://github.com/docker/compose/releases/download/v2.40.0/docker-compose-linux-$ARCH"

Expected Behaviour

If instead, I write a separate Dockerfile and comment out the dockerfile_inline block, then it builds fine:

FROM alpine:latest
ARG ARCH
RUN wget "https://github.com/docker/compose/releases/download/v2.40.0/docker-compose-linux-$ARCH"

Steps To Reproduce

  1. docker compose build

Compose Version

Docker Compose version 2.40.0

Docker Environment

Client:
 Version:    28.5.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  0.29.1
    Path:     /usr/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  2.40.0
    Path:     /usr/lib/docker/cli-plugins/docker-compose
  mcp: Docker MCP Plugin (Docker Inc.)
    Version:  v0.20.0
    Path:     /usr/lib/docker/cli-plugins/docker-mcp

Server:
 Containers: 42
  Running: 12
  Paused: 0
  Stopped: 30
 Images: 42
 Server Version: 28.5.0
 Storage Driver: btrfs
  Btrfs:
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Discovered Devices:
  cdi: nvidia.com/gpu=0
  cdi: nvidia.com/gpu=GPU-87a03c29-583b-822c-7a8a-fccd4b75cc9c
  cdi: nvidia.com/gpu=all
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 nvidia runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 75cb2b7193e4e490e9fbdc236c0e811ccaba3376.m
 runc version:
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
Kernel Version: 6.17.1-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 24
 Total Memory: 31.26GiB
 Name: **********
 ID: ***********
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Default Address Pools:
   Base: 172.18.0.0/16, Size: 24
   Base: 172.19.0.0/16, Size: 24
   Base: 172.20.0.0/16, Size: 24
   Base: 172.21.0.0/16, Size: 24
   Base: 172.22.0.0/16, Size: 24
   Base: 172.23.0.0/16, Size: 24
   Base: 172.24.0.0/16, Size: 24
   Base: 172.25.0.0/16, Size: 24
   Base: 172.26.0.0/16, Size: 24
   Base: 172.27.0.0/16, Size: 24
   Base: 172.28.0.0/16, Size: 24
   Base: 172.29.0.0/16, Size: 24
   Base: 172.30.0.0/16, Size: 24

Anything else?

I recently updated docker, docker-compose and docker-buildx, so I presume it is a regression:-

$ grep 'docker\|compose' /var/log/pacman.log  | tail
[2025-08-02T16:21:02+0100] [ALPM] upgraded docker-compose (2.38.2-1 -> 2.39.1-1)
[2025-08-24T12:31:22+0100] [ALPM] upgraded docker-compose (2.39.1-1 -> 2.39.2-1)
[2025-08-29T12:05:33+0100] [ALPM] upgraded docker-buildx (0.26.1-1 -> 0.27.0-1)
[2025-09-10T04:38:19+0100] [ALPM] upgraded docker-buildx (0.27.0-1 -> 0.28.0-1)
[2025-09-13T12:06:55+0100] [ALPM] upgraded docker-compose (2.39.2-1 -> 2.39.3-1)
[2025-09-18T12:18:45+0100] [ALPM] upgraded docker (1:28.3.3-1 -> 1:28.4.0-1)
[2025-09-24T15:11:02+0100] [ALPM] upgraded docker-compose (2.39.3-1 -> 2.39.4-1)
[2025-10-07T20:23:48+0100] [ALPM] upgraded docker (1:28.4.0-1 -> 1:28.5.0-1)
[2025-10-07T20:23:48+0100] [ALPM] upgraded docker-buildx (0.28.0-1 -> 0.29.1-1)
[2025-10-07T20:23:48+0100] [ALPM] upgraded docker-compose (2.39.4-1 -> 2.40.0-1)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions