Buildah

Feb. 4, 2023

it's April 20, 2021 and the latest release of Buildah stands at v1.20.1.

We've been asked a couple of times over the past few weeks, "What's the difference between a Containerfile and a Dockefile?" First off, as you can tell, they have different names. Secondly, that's it, well at least in theory. Read on for more details.

The content, commands, and any features that are usable in a Dockerfile should also be usable in a Containerfile too. That's the design goal. There may be newer options or commands in a Dockerfile that are not usable in a Containerfile. If you find any that you need that are missing, please log an issue and hopefully we can add them to the Containerfile processing code too.

The one small functional difference between the two files is how Buildah and Podman use the files. If there's a Containerfile in the context directory, Podman and Buildah will use that for the build. If there's a Dockerfile in the context directory, the build will use that if there is not a Containerfile present. If both a Containerfile and a Dockerfile are in the context directory, Podman and Buildah will use the Containerfile and will ignore the Dockerfile. Then if you use the --file option, you can name the file pretty much anything you want.

Given all that, at some point in time in the future if we find commands that would be helpful in a Containerfile that are not present in a Dockerfile, then if the community desires, they might be added to the Containerfile processing. There are currently no plans for that and (KOD), I don't anticipate changes like that in the foreseeable future.