How to force the application to read host mac address in docker container?

I save my docker image to a tar archive and I plan to distribute my application with this tar file. I want to provide an authentication mechanism before accessing the image, so that the image can only be used on the specified machine. How can I force my application to read host mac address in docker container?

The point of (in this case network) isolation is that you can’t see all the devices on the host. You can’t “force” the application, but you can ask the users to run the container on the host network like

docker run --network host ...

If you want to support running your application in containers without using the host network, you need an other authentication method. I don’t have any idea what that could be.

I am going to move the topic from the Docker Hub category to DockerEngine, since it looks like you have no problem with Docker Hub.

1 Like