Assign permanent IP to docker container

E

Edude42

Guest
I want to assign a permanent container IP address to some docker containers in order to reference them in a file. Docker currently gives the contains an IP of 172.18.0.X, but it's random based on when they start up.

Essentially, whenever I restart my servers, the container's IP changes.

Is there any way to assign container 1 an IP of 172.18.0.1, container 2 an IP of 172.18.0.2, etc. without them changing?

Continue reading...
 
Top