You have a CI pipeline that builds a monorepo with many Dockerfiles.
You want to efficiently avoid rebuilding Dockerfiles that haven't changed, even when the rest of the monorepo did.
docker-source-checksum
will calculate a hash of:
Dockerfile
contentDockerfile
(figured out by parsing it)and then hashing all of these together, to give you deterministic checksum,
before you even attempt to call docker build
. You can use it as a
deterministic content-based ID to avoid rebuilding containers that
were already built (eg. by taging them with that checksum).
Dockerfiles
["src1", "src", "dst"]
syntax of ADD
and COPY
is not supported (PRs welcome)Having said that, seems to work great.
See docker-source-checksum releases,
or use cargo install docker-source-checksum
.
Somewhat similiar to docker build
:
``` $ docker-source-checksum --help docker-source-checksum 0.2.0 Dockerfile source checksum
USAGE:
docker-source-checksum [FLAGS] [OPTIONS]
FLAGS: -h, --help Prints help information --hex Output hash in hex -V, --version Prints version information
OPTIONS:
--extra-path Dockerfile
--ignore-path
ARGS: