Description
According to the API documentation, the container Config field is meant to indicate portable configuration between hosts, however, since v25, this field will include the dynamically generated Mac address, which doesn't seem to fit the definition of portable.
This also means that the Config field no longer reflects the configuration options passed to docker run, e.g.
docker network create my-network
# Config.MacAddress should be null for this container
docker run --rm -d --name test --network my-default --mac-address "" alpine sleep infinity
Reproduce
docker network create my-network
docker run --rm -d --name test --network my-default --mac-address "" alpine sleep infinity
# Output: "02:42:ac:13:00:02"
docker inspect test | jq .[].Config.MacAddress
Expected behavior
docker network create my-network
docker run --rm -d --name test --network my-default --mac-address "" alpine sleep infinity
# Output: null
docker inspect test | jq .[].Config.MacAddress
This is the behavior on v24
docker version
Client:
Version: 25.0.1
API version: 1.44
Go version: go1.21.6
Git commit: 29cf629
Built: Tue Jan 23 23:08:36 2024
OS/Arch: linux/arm64
Context: default
Server: Docker Engine - Community
Engine:
Version: 25.0.1
API version: 1.44 (minimum version 1.24)
Go version: go1.21.6
Git commit: 71fa3ab0
Built: Tue Jan 23 23:09:53 2024
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: v1.7.12
GitCommit: 71909c1814c544ac47ab91d2e8b84718e517bb99
runc:
Version: 1.1.11
GitCommit: v1.1.11-0-g4bccb38
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker info
Client:
Version: 25.0.1
API version: 1.44
Go version: go1.21.6
Git commit: 29cf629
Built: Tue Jan 23 23:08:36 2024
OS/Arch: linux/arm64
Context: default
Server: Docker Engine - Community
Engine:
Version: 25.0.1
API version: 1.44 (minimum version 1.24)
Go version: go1.21.6
Git commit: 71fa3ab0
Built: Tue Jan 23 23:09:53 2024
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: v1.7.12
GitCommit: 71909c1814c544ac47ab91d2e8b84718e517bb99
runc:
Version: 1.1.11
GitCommit: v1.1.11-0-g4bccb38
docker-init:
Version: 0.19.0
GitCommit: de40ad0
/ # docker info
Client:
Version: 25.0.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.12.1
Path: /usr/local/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.24.3
Path: /usr/local/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 1
Server Version: 25.0.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 71909c1814c544ac47ab91d2e8b84718e517bb99
runc version: v1.1.11-0-g4bccb38
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.4.16-linuxkit
Operating System: Alpine Linux v3.19 (containerized)
OSType: linux
Architecture: aarch64
CPUs: 10
Total Memory: 7.661GiB
Name: 2432cd5dbabf
ID: 156ffbd8-a35d-4e24-a5d3-cac9a6a03eb8
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
Additional Info
No response
Description
According to the API documentation, the container
Configfield is meant to indicate portable configuration between hosts, however, since v25, this field will include the dynamically generated Mac address, which doesn't seem to fit the definition of portable.This also means that the Config field no longer reflects the configuration options passed to docker run, e.g.
Reproduce
Expected behavior
This is the behavior on v24
docker version
Client: Version: 25.0.1 API version: 1.44 Go version: go1.21.6 Git commit: 29cf629 Built: Tue Jan 23 23:08:36 2024 OS/Arch: linux/arm64 Context: default Server: Docker Engine - Community Engine: Version: 25.0.1 API version: 1.44 (minimum version 1.24) Go version: go1.21.6 Git commit: 71fa3ab0 Built: Tue Jan 23 23:09:53 2024 OS/Arch: linux/arm64 Experimental: false containerd: Version: v1.7.12 GitCommit: 71909c1814c544ac47ab91d2e8b84718e517bb99 runc: Version: 1.1.11 GitCommit: v1.1.11-0-g4bccb38 docker-init: Version: 0.19.0 GitCommit: de40ad0docker info
Additional Info
No response