docker buildx dap build

June 10, 2026 ยท View on GitHub

Start a build

Options

NameTypeDefaultDescription
--add-hoststringSliceAdd a custom host-to-IP mapping (format: host:ip)
--allowstringArrayAllow extra privileged entitlement (e.g., network.host, security.insecure, device, buildx.local.delete)
--annotationstringArrayAdd annotation to the image
--atteststringArrayAttestation parameters (format: type=sbom,generator=image)
--build-argstringArraySet build-time variables
--build-contextstringArrayAdditional build contexts (e.g., name=path)
--builderstringOverride the configured builder instance
--cache-fromstringArrayExternal cache sources (e.g., user/app:cache, type=local,src=path/to/dir)
--cache-tostringArrayCache export destinations (e.g., user/app:cache, type=local,dest=path/to/dir)
--callstringbuildSet method for evaluating build (check, outline, targets)
--cgroup-parentstringSet the parent cgroup for the RUN instructions during build
--checkboolShorthand for --call=check
-D, --debugboolEnable debug logging
-f, --filestringName of the Dockerfile (default: PATH/Dockerfile)
--iidfilestringWrite the image ID to a file
--labelstringArraySet metadata for an image
--loadboolShorthand for --output=type=docker
--metadata-filestringWrite build result metadata to a file
--networkstringdefaultSet the networking mode for the RUN instructions during build
--no-cacheboolDo not use cache when building the image
--no-cache-filterstringArrayDo not cache specified stages
-o, --outputstringArrayOutput destination (format: type=local,dest=path)
--platformstringArraySet target platform for build
--policystringArrayPolicy configuration (format: filename=path[,filename=path][,reset=true|false][,disabled=true|false][,strict=true|false][,log-level=level])
--progressstringautoSet type of progress output (auto, none, plain, quiet, rawjson, tty). Use plain to show container output
--provenancestringShorthand for --attest=type=provenance
--pullboolAlways attempt to pull all referenced images
--pushboolShorthand for --output=type=registry,unpack=false
-q, --quietboolSuppress the build output and print image ID on success
--resourcestringArrayResource limits for build containers (format: memory=2g, cpu-quota=50000)
--sbomstringShorthand for --attest=type=sbom
--secretstringArraySecret to expose to the build (format: id=mysecret[,src=/local/secret])
--shm-sizebytes0Shared memory size for build containers
--sshstringArraySSH agent socket or keys to expose to the build (format: default|<id>[=<socket>|<key>[,<key>]])
-t, --tagstringArrayImage identifier (format: [registry/]repository[:tag])
--targetstringSet the target build stage to build
--ulimitulimitUlimit options

Description

Start a debug session using the debug adapter protocol to communicate with the debugger UI.

Arguments are the same as the build

Note

buildx dap build command may receive backwards incompatible features in the future if needed. We are looking for feedback on improving the command and extending the functionality further.

Examples

Launch request arguments

The following launch request arguments are supported. These are sent as a JSON body as part of the launch request.

NameTypeDefaultDescription
dockerfilestringDockerfileName of the Dockerfile
contextPathstring.Set the context path for the build (normally the first positional argument)
targetstringSet the target build stage to build
stopOnEntrybooleanfalseStop on the first instruction

Additional Arguments

Command line arguments may be passed to the debug adapter the same way they would be passed to the normal build command and they will set the value. Launch request arguments that are set will override command line arguments if they are present.

A debug extension should include an args and builder entry in the launch configuration. These will modify the arguments passed to the binary for the tool invocation. builder will add --builder <arg> directly after the executable and args will append to the end of the tool invocation. For example, a launch configuration in Visual Studio Code with the following:

{
    "args": ["--build-arg", "FOO=AAA"]
    "builder": ["mybuilder"]
}

This should cause the debug adapter to be invoked as docker buildx --builder mybuilder dap build --build-arg FOO=AAA.