Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker builder build vs docker build

Tags:

docker

On Docker's documentation page, there's an entry for docker builder which is the parent command of docker builder build. docker builder build seems like the exact same command as docker build, and the documentations provides no information about it. Are they literally the same thing?

like image 268
bli00 Avatar asked Oct 24 '19 19:10

bli00


1 Answers

Yes, currently they are behaving the same and builder is an alias. To understand why builder subcommand was presented, look at the commit message:

Add new builder subcommand and implement builder prune to prune build cache.

This patch adds a new builder subcommand, allowing to add more builder-related commands in the future. Unfortunately build expects an argument so could not be used as a subcommand.

This also implements docker builder prune, which is needed to prune the builder cache manually without having to call docker system prune.

Today when relying on the legacy builder, users are able to prune dangling images (used as build cache) by running docker image prune. This patch allows the same usecase with buildkit.

like image 51
funnydman Avatar answered Sep 19 '22 15:09

funnydman