saltstack / saltstack/salt

[BUG] Create Docker container with a custom MAC address

Open
#66,882 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
We can't create a Docker container with a custom MAC address due to the docker package problem.

Setup

  • [ x ] on-prem machine
  • [ x ] used bootstrap to install

Steps to Reproduce the behavior

  • Try to create a docker container with the mac_address option.
  • The created container does not have any Network.host.MacAddress value.

Expected behavior

Create Docker container

Screenshots

image

Versions Report

salt --versions-report
Salt Version:
          Salt: 3006.5

Python Version:
        Python: 3.9.2 (default, Feb 28 2021, 17:03:44)

Dependency Versions:
          cffi: 1.16.0
      cherrypy: Not Installed
      dateutil: 2.8.1
     docker-py: 7.1.0
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.3
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.7
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.2
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.20.0
        pygit2: Not Installed
  python-gnupg: Not Installed
        PyYAML: 6.0.1
         PyZMQ: 25.1.2
        relenv: Not Installed
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: debian 11.11 bullseye
        locale: utf-8
       machine: x86_64
       release: 5.10.0-30-amd64
        system: Linux
       version: Debian GNU/Linux 11.11 bullseye

Additional context

I think there is a problem with the create_host_config function in the docker-py package as I mentioned here. There isn't any mac_address option for this function, therefore we'll see a warning:

[WARNING ] The following arguments were ignored because they are not recognized by docker-py: ['mac_address']

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Salt's Docker container creation path and its call to docker-py's create_host_config, then reproduce the issue with the mac_address option. Confirm that the option is passed without the warning and that the created container reports Network.host.MacAddress; check the linked docker-py issue for dependency behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.