v0.3.3
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE1MTdYA1m9lqO/FEeGPNoXAAiv/MFAluqbhEACgkQGPNoXAAi
v/MRkg//UF4k/mdoyxtpylfFbBfglR15pmM5orvU6X3mxi8kIY12lZO2UE/JFkHt
jnz32kQMLvuEstLtmqyimK+D7vIj2+EBnXxVPZ96LW6vEhQmPMdaSrP+130BDy4h
kU+tpyR5i4TMGWgiIpzQAl/ZGDMYw4VaolryJFGca8ERgxSXxEQYARtF3ABkAO+a
vvTW/iFJbx/HQwZq8GW6uIvDnRUo0zr4d4C3+UsbbsUHN6y8jtjpH4/mYpqclALt
mQzvNIjEWPFMhQ+gPCzI/Vhnm9vfzuR8Sbi34JdLLnBF5BJ4R6yMW3lrzVElyMy3
CsudDDp/iYYxyXBHIw3/6LrxnkFcu8qzLzZ60AnjsrY8iGtHikYJyGbxuz89En55
w6hOt/TKK7HkmSoOqW1Rq0sbIJFoRyVTagscqO1IrDM2iAwv9ww7numpWaN/fimI
CsmsJFSz1fyfuxEOfwOF9vhb1qkJ6K6P02RrsH6W6L2jtQepTEqFuebqcUM+F5ZR
q9/Ec5/J8CprqHbIbdjqAUFxu/5tOmLuKSEjwT/Y+lT9vkKGM9M7lwekiDr+5zMk
0oUZP/MLDXVIOoegLqTfRlTfINNe6OrWgi4RuLOE0PlGfqvi1yy0vmgB12lT+GUk
Jm7CpfGjwTT5CgtdOWPH+CT+0wUD0DEVsU/DnN7TvEc06PeHI5E=
=cEOB
-----END PGP SIGNATURE-----
Bump version to v0.3.3

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
1 file changed
tree: 10d40bd3bb048918a64cd702d71e8de98040b824
  1. .gitignore
  2. .goosarch
  3. .travis.yml
  4. .traviskey
  5. Dockerfile
  6. LICENSE
  7. Makefile
  8. README.md
  9. VERSION.txt
  10. base.go
  11. basic.mk
  12. dump.go
  13. format.go
  14. go.mod
  15. go.sum
  16. main.go
  17. maintainer.go
  18. vendor/
  19. version/
README.md

dockfmt

Travis CI GoDoc

Dockerfile format.

NOTE: This is a work in progress so calm yourself if you want to file 80 bajillion issues.

Installation

Binaries

For installation instructions from binaries please visit the Releases Page.

Via Go

$ go get github.com/jessfraz/dockfmt

Usage

$ dockfmt -h
dockfmt -  Dockerfile format.

Usage: dockfmt <command>

Flags:

  -d, --debug  enable debug logging (default: false)

Commands:

  base        List the base image used in the Dockerfile(s).
  dump        Dump parsed Dockerfile(s).
  fmt         Format the Dockerfile(s).
  maintainer  List the maintainer for the Dockerfile(s).
  version     Show the version information.

Format

Get help

$ dockfmt fmt -h
Usage: dockfmt fmt [OPTIONS] DOCKERFILE [DOCKERFILE...]

Format the Dockerfile(s).

Flags:

  -D, --diff   display diffs instead of rewriting files (default: false)
  -d, --debug  enable debug logging (default: false)
  -l, --list   list files whose formatting differs from dockfmt's (default: false)
  -w, --write  write result to (source) file instead of stdout (default: false)

Get a diff

$ dockfmt format -d htop/Dockerfile
diff htop/Dockerfile dockfmt/htop/Dockerfile
--- /tmp/dockfmt143910590	2016-09-19 15:59:22.612250710 -0700
+++ /tmp/dockfmt412224773	2016-09-19 15:59:22.612250710 -0700
@@ -4,10 +4,11 @@
 # 	--pid host \
 # 	jess/htop
 #
-FROM alpine:latest
-MAINTAINER Jessie Frazelle <jess@linux.com>
+
+FROM	alpine:latest
+MAINTAINER	Jessie Frazelle <jess@linux.com>

-RUN apk --no-cache add \
+RUN	apk add --no-cache \
 	htop

-CMD [ "htop" ]
+CMD	["htop"]

List multiple files with different output

$ dockfmt fmt -l */Dockerfile */*/Dockerfile
ab/Dockerfile
afterthedeadline/Dockerfile
android-tools/Dockerfile
ansible/Dockerfile
apt-file/Dockerfile
atom/Dockerfile
audacity/Dockerfile
awscli/Dockerfile
beeswithmachineguns/Dockerfile
buttslock/Dockerfile
camlistore/Dockerfile
cathode/Dockerfile
...

Base image inspection

$ dockfmt base */Dockerfile */*/Dockerfile
BASE                          COUNT
debian:stretch                50
alpine:latest                 30
debian:sid                    28
ubuntu:16.04                  12
alpine:edge                   7
python:2-alpine               3
ruby:alpine                   2
java:7-alpine                 2
r.j3ss.co/wine                1
kalilinux/kali-linux-docker   1
haskell                       1
mhart/alpine-node:5           1
r.j3ss.co/cpuminer            1
opensuse                      1
java:8-alpine                 1
golang:latest                 1

Maintainer inspection

$ dockfmt maintainer */Dockerfile */*/Dockerfile
MAINTAINER                                      COUNT
Jessie Frazelle <jess@jskdj.com>                113
Christian Koep <christian.koep@ksldkfj.de>      11
Justin Garrison <justinleegarrison@hskdl.com>   2
Daniel Romero <infoslack@jjskl.com>             1
Cris G c@skdlemfhtj.com                         1