forked from docker/docker-hoster
Compare commits
5 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
e379c6e8b4 | |
|
|
581f5c1e66 | |
|
|
74fa987b9e | |
|
|
05231ffae0 | |
|
|
c0436fd225 |
|
|
@ -1,4 +1,4 @@
|
|||
FROM frolvlad/alpine-python3
|
||||
FROM python:3-alpine
|
||||
|
||||
RUN pip3 install docker
|
||||
RUN mkdir /hoster
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ def get_container_data(dockerClient, container_id):
|
|||
container_hostname = info["Config"]["Hostname"]
|
||||
container_name = info["Name"].strip("/")
|
||||
container_ip = info["NetworkSettings"]["IPAddress"]
|
||||
if info["Config"]["Domainname"]:
|
||||
container_hostname = container_hostname + "." + info["Config"]["Domainname"]
|
||||
|
||||
result = []
|
||||
|
||||
|
|
@ -104,7 +106,8 @@ def update_hosts_file():
|
|||
break;
|
||||
|
||||
#remove all the trailing newlines on the line list
|
||||
while lines[-1].strip()=="": lines.pop()
|
||||
if lines:
|
||||
while lines[-1].strip()=="": lines.pop()
|
||||
|
||||
#append all the domain lines
|
||||
if len(hosts)>0:
|
||||
|
|
|
|||
Loading…
Reference in New Issue