Limit the length of the hostname to 63 characters due to the hostname length limitation 65/34765/1
authorasteroide <thomas.duval@orange.com>
Wed, 10 May 2017 08:38:55 +0000 (10:38 +0200)
committerasteroide <thomas.duval@orange.com>
Wed, 10 May 2017 08:38:55 +0000 (10:38 +0200)
Change-Id: I8552b9f29e8bae04d8f6fcaf2085402b2250e7e8

moonv4/moon_orchestrator/moon_orchestrator/dockers.py

index 2eecdc0..0b53de9 100644 (file)
@@ -148,7 +148,7 @@ RUN pip3 install --upgrade .
 
         output = self.docker.create_container(image=self.tag,
                                               command=list(self.run_cmd),
-                                              hostname=str(self.id.replace("_", "-")),
+                                              hostname=str(self.id.replace("_", "-"))[:63],
                                               name=str(self.id),
                                               networking_config=self.__get_docker_network(),
                                               host_config=host_config