hyperledger/fabric · error
docker build is disabled
Error message
docker build is disabled
What it means
disabledDockerBuilder is a ccapi build implementation installed when the peer is configured with external builders and Docker builds are disabled. Its Build method unconditionally returns this error, so any attempt to build a chaincode package via the legacy Docker path fails with this message.
Source
Thrown at internal/peer/node/start.go:162
mdBytes []byte,
codePackage io.Reader,
) (container.Instance, error) {
i, err := e.detector.Build(ccid, mdBytes, codePackage)
if err != nil {
return nil, err
}
// ensure <nil> is returned instead of (*externalbuilder.Instance)(nil)
if i == nil {
return nil, nil
}
return i, err
}
type disabledDockerBuilder struct{}
func (disabledDockerBuilder) Build(string, *persistence.ChaincodePackageMetadata, io.Reader) (container.Instance, error) {
return nil, errors.New("docker build is disabled")
}
type endorserChannelAdapter struct {
peer *peer.Peer
}
func (e endorserChannelAdapter) Channel(channelID string) *endorser.Channel {
if peerChannel := e.peer.Channel(channelID); peerChannel != nil {
return &endorser.Channel{
IdentityDeserializer: peerChannel.MSPManager(),
}
}
return nil
}
type custodianLauncherAdapter struct {
launcher chaincode.LauncherView on GitHub (pinned to 2736b63f8f)
Solutions
- Package and deploy the chaincode as an external builder package so the disabled Docker path is never used.
- Re-enable Docker builds in peer configuration if legacy Docker chaincode is required.
- Verify the external builder definitions match the chaincode package type (type/label in the package metadata).
Example fix
// before
peer lifecycle chaincode package cc.tar.gz --path . --lang golang --label cc1 # requires docker build (disabled)
// after
# package as CC-type external package
{ "path": "...", "type": "cc" } ; peer lifecycle chaincode package ext.tar.gz --path . --lang binary --label cc1 Defensive patterns
Strategy: validation
Validate before calling
// before install/instantiate on a docker-build-disabled peer, ensure package is external-builder compatible
if pkg.Type != "cc" { return fmt.Errorf("peer has docker builds disabled; use external builder package") } Try / catch
if err := installChaincode(pkg); err != nil && err.Error() == "docker build is disabled" {
return fmt.Errorf("repackage as external builder package or re-enable docker builds: %w", err)
} Prevention
- On peers with Docker builds disabled, only deploy chaincode handled by external builders.
- Verify builder definitions match package type/label before install.
- Document the disabled-build posture so operators don't ship legacy Docker chaincode.
When it happens
Trigger: Invoking chaincode build/install flow on a peer where CORE_CHAINCODE_EXTERNALBUILDERS / docker build disablement is configured, but the chaincode package is not handled by an external builder, so it falls through to disabledDockerBuilder.Build.
Common situations: Operating a locked-down peer with docker builds disabled (e.g. for security) while deploying legacy chaincode that still requires Docker builds; forgetting to package chaincode for external builders; misconfigured external builder paths.
Related errors
- only applicable for private data
- unknown operation type
- error reading chaincode install package at %s
- Unknown chaincodeType: %s
- Failed to generate platform-specific Dockerfile: %s
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/41de383f2f88767f.
Report an issue: GitHub.