v0.3.2
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE1MTdYA1m9lqO/FEeGPNoXAAiv/MFAltOSDEACgkQGPNoXAAi
v/MchBAAnsgxyF2M+OtcrhOTcV4nU0YqBywhluZpp0PLoRclQFe4Qh7znVxQuHI/
sGlGYJpOwaB69CO5wjjJLtxVu6UZ4SQ5pzC7HfQ5owztT6wTU5zA+drQcY7u5EG9
om54JFJtYRP1zIr/gUq+MGoHjEU2CQjvY6hb0BIld8OF/mwEOZi0Mff2dMzCiTtz
v/0s3rF8j7d2YZt3evAt69junxHoAV4DsE4bZ3qGFjvrveKX7twN+asYJe1mlPQR
jjxKNeb8+fAg7wtMBCWDirIlmipVSIvQ/d2MKK2eV1WrwweT/iAIvL1qYViusV0e
zawmvpVSnKC/HPhWip/OOtkaFv7BPqJuuUlaz0zGb+o1UxjZpG5T7RijW13r8k1u
rlBiEx9ILSFUi7kgmoI0YgeB//PO3lmTmEtb7paUQydEpHwb/yUYzRhFfr51b6gt
+Kj5+pLc/P3zsYhLYrRWT57RuNBW0lTak8KMob+guNSXi2/y++uGfou8IyivS0zL
CQPMI6S2MZFjywcWR1K76EVsKwlSM/DmZ4U5gFolE1R1kJQ3g41qNnuYJXsgsQ0P
hImna4d0IjAFDQcXze39D/HILNgazLBqBYOAJkdCu2e3XGJDg0wTA3HpoKIQEU4A
Ownfe48xMI+MsBLuvdRveVC/TUR6ylSKyBLPPaNBkYoCg8Om7UE=
=U/x+
-----END PGP SIGNATURE-----
Bump version to v0.3.2

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

dockfmt

Travis CI

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