Description
Description
Since builds that use buildkit features are not backwards compatible with the classic docker build, I would like details from the CLI that can be used in Makefiles and other build scripts to switch between different Dockerfiles based on whether buildkit is enabled. This would allow the same scripts to be run on different platforms, while still receiving the benefits of buildkit when it's available.
Describe the results you expected:
$ docker info --format '{{.ClientInfo.Feature.Buildkit}}'
enabled
Additional information you deem important (e.g. issue happens only occasionally):
I'd prefer to not override the user preferences if they've disabled buildkit either in the daemon.json, or by setting DOCKER_BUILDKIT=0
, and I'd like to support remote docker engines where parsing the daemon.json file would be impractical.
Output of docker version
:
Client: Docker Engine - Community
Version: 20.10.5
API version: 1.41
Go version: go1.13.15
Git commit: 55c4c88
Built: Tue Mar 2 20:17:50 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.5
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 363e9a8
Built: Tue Mar 2 20:15:47 2021
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.4.4
GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
runc:
Version: 1.0.0-rc93
GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Output of docker info
:
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
compose: Define and run multi-container applications (Docker, 1.28.2)
instadock: Deploy docker nodes with ansible and terraform (InstaDock, 0.1)
linstadock: Deploy docker nodes with ansible and terraform (InstaDock, 0.1)
regctl: Manage docker registries (regclient, 0.1)
Server:
Containers: 20
Running: 13
Paused: 0
Stopped: 7
Images: 228
Server Version: 20.10.5
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: active
NodeID: dqsh1676dth0ip0hlrccy893b
Is Manager: true
ClusterID: 4br5nravhmolmnau4vi5tsq1a
Managers: 1
Nodes: 1
Default Address Pool: 10.0.0.0/8
SubnetSize: 24
Data Path Port: 4789
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 10
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 127.0.0.1
Manager Addresses:
127.0.0.1:2377
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
runc version: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.19.0-10-amd64
Operating System: Debian GNU/Linux 10 (buster)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.17GiB
Name: bmitch-t490
ID: PBKW:E6DI:RN6M:OIXQ:XQ4G:FR5U:VHV2:DTOY:ATUP:WRJM:27G2:ON4H
Docker Root Dir: /home/docker
Debug Mode: false
Username: sudobmitch
Registry: https://index.docker.io/v1/
Labels:
from_ansible=true
laptop=true
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Default Address Pools:
Base: 192.168.64.0/19, Size: 24
Additional environment details (AWS, VirtualBox, physical, etc.):
Bare metal on Debian, but I'd like this to apply to all environments, including DinD and remote docker engines accessed with DOCKER_HOST=ssh://user@host
.