I don't want to vouch for the flagged and dead comment https://news.ycombinator.com/item?id=43630653 because I suspect it was killed for its tone but wow it is really illustrative of the QA that didn't go into this product
Dockerfmt: A Dockerfile Formatter
61–67 of 67 posts
Re: Dockerfmt: A Dockerfile Formatter
#62Earlier quoted context omitted.
Or, you can write an actual shell script file (i.e. with a .sh extension) to be stored in your repository, ADD it in a throwaway context (i.e. multi-stage builds), then RUN --mount=type=bind to put it into a temporary directory in the build container so that you can execute it. This way, the script doesn't pollute the container, and you have proper separation of concerns, including the ability to use library function…
That's bad practice because it hides build steps from `docker inspect`. Per https://github.com/docker-library/official-images#clarity : > Try to make the Dockerfile easy to understand/read. It may be tempting, for the sake of brevity, to put complicated initialization details into a standalone script and merely add a RUN command in the Dockerfile. However, this causes the resulting Dockerfile to be overly opaque, and…
Re: Dockerfmt: A Dockerfile Formatter
#63Earlier quoted context omitted.
Hi there — I’ll try to distribute a docker release of the binary tomorrow!
I think they were asking for a sample Dockerfile in the repo to test it on.
Re: Dockerfmt: A Dockerfile Formatter
#64[flagged]
I fixed this in the 0.2.8 release https://github.com/reteps/dockerfmt/releases/tag/0.2.8.
Relevant reading about the `&&` normalization. https://pkg.go.dev/encoding/json#Marshal
Re: Dockerfmt: A Dockerfile Formatter
#65Earlier quoted context omitted.
Or, you can write an actual shell script file (i.e. with a .sh extension) to be stored in your repository, ADD it in a throwaway context (i.e. multi-stage builds), then RUN --mount=type=bind to put it into a temporary directory in the build container so that you can execute it. This way, the script doesn't pollute the container, and you have proper separation of concerns, including the ability to use library function…
That's bad practice because it hides build steps from `docker inspect`. Per https://github.com/docker-library/official-images#clarity : > Try to make the Dockerfile easy to understand/read. It may be tempting, for the sake of brevity, to put complicated initialization details into a standalone script and merely add a RUN command in the Dockerfile. However, this causes the resulting Dockerfile to be overly opaque, and…
Re: Dockerfmt: A Dockerfile Formatter
#66[flagged]
In the spirit of constructive feedback, I filed an issue for you: https://github.com/reteps/dockerfmt/issues/18 I fixed this in the 0.2.8 release https://github.com/reteps/dockerfmt/releases/tag/0.2.8 . Relevant reading about the `&&` normalization. https://pkg.go.dev/encoding/json#Marshal
-ENTRYPOINT service ssh restart && bash
+ENTRYPOINT ["service", "ssh", "restart", "&&", "bash"]
You should read and understand the documentation for the containerfile format before continuing. This isn't some quirk because i'm using &&, you are breaking almost every dockerfile that doesn't use the array syntax for ENTRYPOINT.Re: Dockerfmt: A Dockerfile Formatter
#67I don't want to vouch for the flagged and dead comment https://news.ycombinator.com/item?id=43630653 because I suspect it was killed for its tone but wow it is really illustrative of the QA that didn't go into this product
What I can do for you is fix the bugs promptly! I resolved the bugs in the `0.2.7` release. I haven't graduated college yet and don't have a full time job, so my QA skills are still improving.