# Dockerfile syntax : Yaml to dockerfile

**URL:** <https://forums.docker.com/t/dockerfile-syntax-yaml-to-dockerfile/150905>\
**Category:** Image Builds\
**Tags:** docker, build\
**Created:** [January 21, 2026, 8:35pm UTC](https://forums.docker.com/t/dockerfile-syntax-yaml-to-dockerfile/150905 "2026-01-21T20:35:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronnahmany](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@ronnahmany](https://forums.docker.com/u/ronnahmany)\
**Post date:** [January 21, 2026, 8:35pm UTC](https://forums.docker.com/t/dockerfile-syntax-yaml-to-dockerfile/150905/1 "2026-01-21T20:35:40Z")

</div>

Hi , i started to use docker DHI as part of my day to day docker image builds , and i saw that the new docker DHI has yaml formated dockerfile i thins its the syntax layer (`# syntax=dhi.io/build:2-debian13`)

I was wondering if i can get that syntax or if its going to be publicly available any time soon ?

For the devops guys out there , managing and templating yaml is so much easier

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [January 21, 2026, 11:05pm UTC](https://forums.docker.com/t/dockerfile-syntax-yaml-to-dockerfile/150905/2 "2026-01-21T23:05:26Z")

</div>

It should already be available. The string after the syntax keyword is a tag of a Docker image. The same method is used and documented for other features

> **[Custom Dockerfile syntax](https://docs.docker.com/build/buildkit/frontend/)**
>
> Dive deep into the Dockerfile frontend, and learn about custom frontends

If you go to the hardened images browser and search for “build”, you should find the image, but you need to log in to `dhi.io` as you would to pull other hardened images.

---

<div class="post-metadata">

**Author:** ![ronnahmany](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@ronnahmany](https://forums.docker.com/u/ronnahmany)\
**Post date:** [January 22, 2026, 10:21am UTC](https://forums.docker.com/t/dockerfile-syntax-yaml-to-dockerfile/150905/3 "2026-01-22T10:21:57Z")

</div>

So maybe i didn’t understand something ,  
I saw in the github the “dockerfile” definition

Example of what i mean  
[Example of the dockerfile in dhi](https://github.com/docker-hardened-images/catalog/blob/main/image/cosign/debian-13/3-dev.yaml)

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [January 22, 2026, 2:16pm UTC](https://forums.docker.com/t/dockerfile-syntax-yaml-to-dockerfile/150905/4 "2026-01-22T14:16:33Z")

</div>

And I replied exactly to that. `# syntax=imagename` defines what buildkit can do, how it can interpret the Dockerfile. Have you tried to build a dockerfile like that?

---

<div class="post-metadata">

**Author:** ![ronnahmany](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@ronnahmany](https://forums.docker.com/u/ronnahmany)\
**Post date:** [January 22, 2026, 2:53pm UTC](https://forums.docker.com/t/dockerfile-syntax-yaml-to-dockerfile/150905/5 "2026-01-22T14:53:31Z")

</div>

I haven’t tried and i was unsure how to use and such.  
Thats the reason i created the post

The docs also talks about the “real” dockerfile commands .

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [January 23, 2026, 12:06pm UTC](https://forums.docker.com/t/dockerfile-syntax-yaml-to-dockerfile/150905/6 "2026-01-23T12:06:15Z")

</div>

Oh… so you are looking for a syntax reference, right? It looks like it is not public yet. I only found what you have probably seen already: [https://hub.docker.com/hardened-images/catalog/dhi/build/guides](https://hub.docker.com/hardened-images/catalog/dhi/build/guides)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/docker/original/3X/d/4/d4fbccd46c81bfcffe9822e20e17736d946fa821.png) [@system](https://forums.docker.com/u/system)\
**Post date:** [February 22, 2026, 12:06pm UTC](https://forums.docker.com/t/dockerfile-syntax-yaml-to-dockerfile/150905/7 "2026-02-22T12:06:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
