docker buildx debug build

docker buildx debug build

docker buildx debug build는 디버그 모드로 빌드를 시작하는 명령이에요. 일반 빌드와 달리 디버깅을 위해 중간 단계를 살펴볼 수 있어요.

출처: 문서

본문

[!NOTE] Experimental

This command is experimental. Experimental features are intended for testing and feedback as their functionality or design may change between releases without warning or can be removed entirely in a future release.

docker buildx debug build는 디버깅 지원과 함께 이미지 빌드를 시작해요. 옵션은 일반 buildx build와 유사해요.

지원하는 옵션은 다음과 같아요.

옵션 기본값 설명
--add-host 커스텀 host-to-IP 매핑을 추가해요 (host:ip)
--allow 추가 권한(entitlement)을 명시적으로 허용해요 (예: network.host, security.insecure)
--annotation 컨테이너에 주석(annotation)을 추가해요 (OCI 런타임으로 전달돼요)
--attest 증명(attestation) 파라미터 (형식: type=sbom,generator=image)
--build-arg 빌드 시 변수를 설정해요
--build-context 추가 빌드 컨텍스트 (예: name=path, name=docker-image://image)
--cache-from 외부 캐시 소스 (예: user/app:cache, type=local,dest=path)
--cache-to 캐시 내보내기 대상 (예: user/app:cache, type=local,dest=path)
--call build 빌드를 평가하는 메서드를 설정해요 (check, outline, targets)
--cgroup-parent 컨테이너의 상위 cgroup을 정해요
--check --call=check의 축약형이에요
-f, --file 빌드 정의 파일
--iidfile 이미지 ID를 파일에 기록해요
--label 컨테이너에 메타데이터를 설정해요
--load --output=type=docker의 축약형이에요
--metadata-file 빌드 결과 메타데이터를 파일에 기록해요
--network 컨테이너를 네트워크에 연결해요
--no-cache 이미지를 빌드할 때 캐시를 사용하지 않아요
--no-cache-filter 지정한 단계만 캐시하지 않아요
-o, --output 파일로 저장해요 (기본은 stdout)
--platform 서버가 멀티플랫폼을 지원하면 플랫폼을 설정해요
--policy 정책 구성 (형식: filename=path[,filename=path]...)
--progress auto 진행 출력 유형을 설정해요 (auto, none, plain, quiet, rawjson, tty)
--provenance --attest=type=provenance의 축약형이에요
--pull 생성 전에 이미지를 가져올지 정해요 (always, missing, never)
--push --output=type=registry,unpack=false의 축약형이에요
-q, --quiet 구성만 검증하고 아무것도 출력하지 않아요
--resource 빌드 컨테이너 리소스 제한 (형식: memory=2g, cpus=4)
--sbom --attest=type=sbom의 축약형이에요
--secret 빌드에 노출할 비밀값 (형식: id=mysecret[,src=/local/file])
--shm-size /dev/shm 크기를 정해요
--ssh 빌드에 노출할 SSH 에이전트 소켓·키 (형식: default 또는 id=path)
-t, --tag 새 이미지 참조를 설정해요 (형식: [registry/]repository[:tag])
--target 빌드할 target build stage를 설정해요
--ulimit ulimit 옵션을 정해요

더 알아보기