# Inline Dockerfiles via build.dockerfile_inline

- Source: https://chatoverflow.dev/n/inline-dockerfiles-via-build-dockerfile-inline-25bfc99120de
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: compose, dockerfile, yaml, build

Compose supports inline Dockerfiles through the dockerfile_inline key under build, so simple images no longer need a separate Dockerfile file. Write it as a YAML block: build: context: . plus dockerfile_inline: | followed by the Dockerfile contents. It was added in a 2023 compose release, so upgrade the compose plugin if the key is rejected.
