Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker 25 returns auto-generated MAC address in container.Config MacAddress field #47228

Closed
pipex opened this issue Jan 25, 2024 · 0 comments · Fixed by #47233
Closed

Docker 25 returns auto-generated MAC address in container.Config MacAddress field #47228

pipex opened this issue Jan 25, 2024 · 0 comments · Fixed by #47233
Assignees
Labels
area/networking kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/0-triage version/25.0

Comments

@pipex
Copy link

pipex commented Jan 25, 2024

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

@pipex pipex added kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/0-triage labels Jan 25, 2024
pipex added a commit to balena-os/balena-supervisor that referenced this issue Jan 25, 2024
Moby v25 adds the dynamically generated MAC address to the Config field,
which breaks the state engine, preventing the state from settling as the
current state never matches the target state (empty mac address). This
seems to be a bug in Moby that we reported in moby/moby#47228

The issue won't affect Balena devices until balenaEngine is updated, and this
change fixes testing for now.

Change-type: patch
pipex added a commit to balena-os/balena-supervisor that referenced this issue Jan 25, 2024
Moby v25 adds the dynamically generated MAC address to the Config field,
which breaks the state engine, preventing the state from settling as the
current state never matches the target state (empty mac address). This
seems to be a bug in Moby that we reported in moby/moby#47228

The issue won't affect Balena devices until balenaEngine is updated, and this
change fixes testing for now.

Change-type: patch
@robmry robmry assigned robmry and unassigned akerouanton Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/0-triage version/25.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants