Share feedback
Answers are generated based on the documentation.

docker buildx dap build

内容説明Start a build
利用方法docker buildx dap build [OPTIONS] PATH | URL | -

試験的

このコマンドは試験的なものです。

試験的機能はテスト向けに意図されたものであり、その機能に関してのフィードバックを得る目的があります。 この機能はリリース時に予告なく変更される場合があり、また今後のリリースに向けて削除されることがあります。

内容説明

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

Arguments are the same as the build

メモ

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.

オプション

オプションデフォルト内容説明
--add-hostAdd a custom host-to-IP mapping (format: host:ip)
--allowAllow extra privileged entitlement (e.g., network.host, security.insecure, device)
--annotationAdd annotation to the image
--attestAttestation parameters (format: type=sbom,generator=image)
--build-argSet build-time variables
--build-contextAdditional build contexts (e.g., name=path)
--cache-fromExternal cache sources (e.g., user/app:cache, type=local,src=path/to/dir)
--cache-toCache export destinations (e.g., user/app:cache, type=local,dest=path/to/dir)
--callbuildSet method for evaluating build (check, outline, targets)
--cgroup-parentSet the parent cgroup for the RUN instructions during build
--checkShorthand for --call=check
-f, --fileName of the Dockerfile (default: PATH/Dockerfile)
--iidfileWrite the image ID to a file
--labelSet metadata for an image
--loadShorthand for --output=type=docker
--metadata-fileWrite build result metadata to a file
--networkSet the networking mode for the RUN instructions during build
--no-cacheDo not use cache when building the image
--no-cache-filterDo not cache specified stages
-o, --outputOutput destination (format: type=local,dest=path)
--platformSet target platform for build
--policyPolicy configuration (format: filename=path[,filename=path][,reset=true|false][,disabled=true|false][,strict=true|false][,log-level=level])
--progressautoSet type of progress output (auto, none, plain, quiet, rawjson, tty). Use plain to show container output
--provenanceShorthand for --attest=type=provenance
--pullAlways attempt to pull all referenced images
--pushShorthand for --output=type=registry,unpack=false
-q, --quietSuppress the build output and print image ID on success
--sbomShorthand for --attest=type=sbom
--secretSecret to expose to the build (format: id=mysecret[,src=/local/secret])
--shm-sizeShared memory size for build containers
--sshSSH agent socket or keys to expose to the build (format: default|<id>[=<socket>|<key>[,<key>]])
-t, --tagImage identifier (format: [registry/]repository[:tag])
--targetSet the target build stage to build
--ulimitUlimit options

利用例

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.