{"id":13416491,"url":"https://github.com/jessfraz/dockfmt","last_synced_at":"2025-04-09T04:05:01.032Z","repository":{"id":57490089,"uuid":"68654894","full_name":"jessfraz/dockfmt","owner":"jessfraz","description":"Dockerfile format and parser. Like `gofmt` but for Dockerfiles.","archived":false,"fork":false,"pushed_at":"2024-01-31T22:47:30.000Z","size":10280,"stargazers_count":427,"open_issues_count":6,"forks_count":20,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-10-29T22:34:18.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jessfraz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-19T23:22:45.000Z","updated_at":"2024-09-22T06:31:12.000Z","dependencies_parsed_at":"2024-06-18T21:13:35.058Z","dependency_job_id":"2d8c6daf-3ba2-40b1-8dfe-9ce35dd69d62","html_url":"https://github.com/jessfraz/dockfmt","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessfraz%2Fdockfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessfraz%2Fdockfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessfraz%2Fdockfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessfraz%2Fdockfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jessfraz","download_url":"https://codeload.github.com/jessfraz/dockfmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247974715,"owners_count":21026742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T21:00:59.645Z","updated_at":"2025-04-09T04:05:01.002Z","avatar_url":"https://github.com/jessfraz.png","language":"Go","readme":"# dockfmt\n\n[![make-all](https://github.com/jessfraz/dockfmt/workflows/make%20all/badge.svg)](https://github.com/jessfraz/dockfmt/actions?query=workflow%3A%22make+all%22)\n[![make-image](https://github.com/jessfraz/dockfmt/workflows/make%20image/badge.svg)](https://github.com/jessfraz/dockfmt/actions?query=workflow%3A%22make+image%22)\n[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=for-the-badge)](https://godoc.org/github.com/jessfraz/dockfmt)\n\nDockerfile format.\n\n**NOTE:** This is a work in progress so calm yourself if you want to file 80 bajillion\nissues.\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**\n\n- [Installation](#installation)\n    - [Binaries](#binaries)\n    - [Via Go](#via-go)\n- [Usage](#usage)\n  - [Format](#format)\n    - [Get help](#get-help)\n    - [Get a diff](#get-a-diff)\n    - [List multiple files with different output](#list-multiple-files-with-different-output)\n  - [Base image inspection](#base-image-inspection)\n  - [Maintainer inspection](#maintainer-inspection)\n  - [Stage inspection](#stage-inspection)\n  - [Workdir inspection](#workdir-inspection)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\n## Installation\n\n#### Binaries\n\nFor installation instructions from binaries please visit the [Releases Page](https://github.com/jessfraz/dockfmt/releases).\n\n#### Via Go\n\n```console\n$ go get github.com/jessfraz/dockfmt\n```\n\n## Usage\n\n```console\n$ dockfmt -h\ndockfmt -  Dockerfile format.\n\nUsage: dockfmt \u003ccommand\u003e\n\nFlags:\n\n  -d, --debug  enable debug logging (default: false)\n\nCommands:\n\n  base        List the base image used in the Dockerfile(s).\n  dump        Dump parsed Dockerfile(s).\n  fmt         Format the Dockerfile(s).\n  maintainer  List the maintainer for the Dockerfile(s).\n  stages      List the stages in the Dockerfile.\n  workdir     List the workdirs for the Dockerfile(s).\n  version     Show the version information.\n```\n\n### Format\n\n#### Get help\n\n```console\n$ dockfmt fmt -h\nUsage: dockfmt fmt [OPTIONS] [DOCKERFILE...]\n\nFormat the Dockerfile(s).\n\nFlags:\n\n  -D, --diff   display diffs instead of rewriting files (default: false)\n  -d, --debug  enable debug logging (default: false)\n  -l, --list   list files whose formatting differs from dockfmt's (default: false)\n  -w, --write  write result to (source) file instead of stdout (default: false)\n```\n\n#### Get a diff\n\n```console\n$ dockfmt fmt -d htop/Dockerfile\ndiff htop/Dockerfile dockfmt/htop/Dockerfile\n--- /tmp/dockfmt143910590\t2016-09-19 15:59:22.612250710 -0700\n+++ /tmp/dockfmt412224773\t2016-09-19 15:59:22.612250710 -0700\n@@ -4,10 +4,11 @@\n # \t--pid host \\\n # \tjess/htop\n #\n-FROM alpine:latest\n-MAINTAINER Jessie Frazelle \u003cjess@linux.com\u003e\n+\n+FROM\talpine:latest\n+MAINTAINER\tJessie Frazelle \u003cjess@linux.com\u003e\n\n-RUN apk --no-cache add \\\n+RUN\tapk add --no-cache \\\n \thtop\n\n-CMD [ \"htop\" ]\n+CMD\t[\"htop\"]\n```\n\n#### List multiple files with different output\n\n```console\n$ dockfmt fmt -l */Dockerfile */*/Dockerfile\nab/Dockerfile\nafterthedeadline/Dockerfile\nandroid-tools/Dockerfile\nansible/Dockerfile\napt-file/Dockerfile\natom/Dockerfile\naudacity/Dockerfile\nawscli/Dockerfile\nbeeswithmachineguns/Dockerfile\nbuttslock/Dockerfile\ncamlistore/Dockerfile\ncathode/Dockerfile\n...\n```\n\n### Base image inspection\n\n```console\n$ dockfmt base */Dockerfile */*/Dockerfile\nBASE                          COUNT\ndebian:stretch                50\nalpine:latest                 30\ndebian:sid                    28\nubuntu:16.04                  12\nalpine:edge                   7\npython:2-alpine               3\nruby:alpine                   2\njava:7-alpine                 2\nr.j3ss.co/wine                1\nkalilinux/kali-linux-docker   1\nhaskell                       1\nmhart/alpine-node:5           1\nr.j3ss.co/cpuminer            1\nopensuse                      1\njava:8-alpine                 1\ngolang:latest                 1\n```\n\n### Maintainer inspection\n\n```console\n$ dockfmt maintainer */Dockerfile */*/Dockerfile\nMAINTAINER                                      COUNT\nJessie Frazelle \u003cjess@jskdj.com\u003e                113\nChristian Koep \u003cchristian.koep@ksldkfj.de\u003e      11\nJustin Garrison \u003cjustinleegarrison@hskdl.com\u003e   2\nDaniel Romero \u003cinfoslack@jjskl.com\u003e             1\nCris G c@skdlemfhtj.com                         1\n```\n\n### Stage inspection\n\n```console\n$ dockfmt stages Dockerfile\nSTAGE               INTERPOLATED\nhealth-check        false\npython-deps         false\nstage-2             true\n```\n\n### Workdir inspection\n\n```console\n$ dockfmt workdir */Dockerfile */*/Dockerfile\nWORKDIR   COUNT\n/srv      3\n/app      1\n```\n","funding_links":[],"categories":["Docker Images","Go"],"sub_categories":["Linter"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessfraz%2Fdockfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjessfraz%2Fdockfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessfraz%2Fdockfmt/lists"}