How to specific mac_address when start singleuser docker container?

I need to specific the jupyterlab container’s mac_address.
I try to config jupyterhub_config.py like this: c.DockerSpawner.mac_address = ‘xx.xx.xx.xx.xx’,
but it don’t work.

DockerSpawner has a extra_create_kwargs property that can be used to pass additional arguments to the Docker create_container API method:

https://docker-py.readthedocs.io/en/stable/api.html#docker.api.container.ContainerApiMixin.create_container

I don’t think that’s useful though, because you shouldn’t have duplicate MAC addresses on different containers.

@manics This method is feasible.
Since the MAC address needs to be bound when the third-party API is used, it needs to be done.
Thank you very much!