Why the IP keep changing after a restart of docker container? #44
-
I tried to update my key of a instance runs in docker in my ubuntu machine today, after that I found two machine with same name appear in device list. So I deteled one and then restart the container in docker, another machine with same name and different IP appears. Is this only happens to instances running in docker? How can I keep the IP of an identical machine the same. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The problem is the machineid. We use
We got an error to get correct machine id from the docker or other system like openwrt. AT the moment we use
For your case, the uuid will renew if you recreate a container. |
Beta Was this translation helpful? Give feedback.
-
I suggest adding an environment variable #!/bin/sh
set -e
if [ $OMNIEDGE_MACHINE_ID ];then
echo $OMNIEDGE_MACHINE_ID > /etc/machine-id
else
cp /proc/sys/kernel/random/uuid /etc/machine-id
fi
...
... |
Beta Was this translation helpful? Give feedback.
The problem is the machineid. We use
github.com/panta/machineid
in the omniedge cli to get the machine id from machine.