I have a container that I need to change the MAC address to a static one due to application licensing.
I know docker --mac-address="" will work, but how do I make it work during the image creation with packer?
I have the following process for my centos:7 image:
- download some dependencies (net-tools)
- change mac address
- add local license file based on MAC addess
- all done
I have tried setting
“builders”: [
{
“type”: “docker”,
“image”: “{{user base-image
}}”,
“commit”: true,
“changes”: [
“ENV mac-address=‘52:54:00:ad:f4:73’”,
“ENV LSHOST localhost”
}
]
That does not work.
I have also tried to manually change it with a script before I load the license but I get:
docker: SIOCSIFFLAGS: Operation not permitted
I guess can this even be done and if so how.