Dockerfmt: A Dockerfile Formatter
11–20 of 67 posts
Re: Dockerfmt: A Dockerfile Formatter
#12I just use a yaml LSP which will probably try to lookup the schema.org Containerfile format for this. I first noticed this recently when working on a Github Actions yaml file. Pretty nifty.
But a dockerfile is not yaml. do you mean for docker compose?
Re: Dockerfmt: A Dockerfile Formatter
#13Side question. Why would people continue to build new dockerfiles as opposed to using Podman ?
Dockerfile has been standardized as Containerfile: https://github.com/containers/common/blob/main/docs/Containe...
https://docs.docker.com/build/buildkit/dockerfile-release-no...
If any organization adopted the spec I would hope they would at least make it adopt a standard file extension like .oci so it would at least be more easily recognizable by IDEs, I have never liked having to put the use case as the extension like Dockerfile.dev
But I do like that docker and buildkit have been able to freely evolve the spec with things like advanced caching directives that work great in buildx
Re: Dockerfmt: A Dockerfile Formatter
#14Earlier quoted context omitted.
Podman uses Dockerfiles too. Dockerfiles is the language for specifying a set of instructions for building container images.
It's not a very good one, but it is ubiquitous (it's also better if you remember to include the right syntax marker that enables heredocs): # syntax=docker/dockerfile:1 I suspect that the GP was really asking "why not use a different tool", like buildah https://buildah.io >, buildpacks https://buildpacks.io >, nix https://nix.dev/tutorials/nixos/building-and-running-docker-... >, kaniko https://github.com/GoogleConta…
You lose automatic layer caching, but in exchange you can use the same tools (RUN, ADD, etc) within a much more powerful shell environment.
I wrote a Buildah wrapper that uses a shell script harness to polyfill the familiar Dockerfile syntax while adding several extra goodies - mainly the ability to bake runtime arguments (mounts, ports...) into the image. Very handy!
Re: Dockerfmt: A Dockerfile Formatter
#15I had a chuckle when I looked at the source code and could not find a Dockerfile in there. I want to kick the tires on it and the easiest way would be to run it as a Docker container against an existing file and alas, I cannot.
Re: Dockerfmt: A Dockerfile Formatter
#16I had a chuckle when I looked at the source code and could not find a Dockerfile in there. I want to kick the tires on it and the easiest way would be to run it as a Docker container against an existing file and alas, I cannot.
Re: Dockerfmt: A Dockerfile Formatter
#17For anyone looking to try dockerfmt, I just added a plugin to Qlty CLI, which is available in v0.508.0. The plugin took about ten minutes to add: https://github.com/qltysh/qlty/blob/main/qlty-plugins/plugin...
Full disclosure: I'm the founder of Qlty, which produces a universal code linter and formatter, Qlty CLI (https://github.com/qltysh/qlty). It is completely free and published under a Fair Source license.
Re: Dockerfmt: A Dockerfile Formatter
#18I had a chuckle when I looked at the source code and could not find a Dockerfile in there. I want to kick the tires on it and the easiest way would be to run it as a Docker container against an existing file and alas, I cannot.
The project should certainly also be formatting its own docker file via a docker invocation
Re: Dockerfmt: A Dockerfile Formatter
#19Re: Dockerfmt: A Dockerfile Formatter
#20I am firmly in the camp of
RUN set -e ;\
export DEBIAN_FRONTEND=noninteractive ;\
etc etc
so I guess this tool isn't for me