dockerfile-source-checksum

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 7 Imported by: 0

README

docker-source-checksum

Calculates deterministic checksum of a Dockerfile from source.

The checksum is calculated from:

  • Content of the dockerfile
  • Content of local paths added in the dockerfile, from:
    • ADD command
    • COPY command that copies from local directory
    • RUN command that uses --mount=type=bind
  • Parameters from docker build:
    • --build-arg
    • --platform
    • --label

Inspired by github.com/dpc/docker-source-checksum. The major difference is that this tool supports directory from RUN --mount=type=bind and handles variable expansion in dockerfile.

Install

TODO: add binary release

go install github.com/inoc603/dockerfile-source-checksum@latest

Usage

dockerfile-source-checksum -f Dockerfile .
dockerfile-source-checksum \
    -f Dockerfile \
    --build-arg key1=value1 \
    --build-arg key2=value2 \
    --platform linux/amd64 \
    --platform linux/arm64/v8 \
    --label labe1=labelvalue1 \
    .

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL