forked from docker/docker-hoster
Compare commits
6 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
73997fb041 | |
|
|
26ccc5ae52 | |
|
|
50cd480853 | |
|
|
388bc4a4d2 | |
|
|
f8d3f1858e | |
|
|
b0bb8b193c |
|
|
@ -1,4 +1,4 @@
|
||||||
FROM python:3-alpine
|
FROM frolvlad/alpine-python3
|
||||||
|
|
||||||
RUN pip3 install docker
|
RUN pip3 install docker
|
||||||
RUN mkdir /hoster
|
RUN mkdir /hoster
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,12 @@ Hoster provides by default the entries `<container name>, <hostname>, <container
|
||||||
|
|
||||||
For example, the following container would be available via DNS as `myname`, `myhostname`, `et54rfgt567` and `myserver.com`:
|
For example, the following container would be available via DNS as `myname`, `myhostname`, `et54rfgt567` and `myserver.com`:
|
||||||
|
|
||||||
docker run -d \
|
docker run --restart=unless-stopped -d \
|
||||||
--name myname \
|
--name myname \
|
||||||
--hostname myhostname \
|
--hostname myhostname \
|
||||||
--network somenetwork --network-alias "myserver.com" \
|
--network somenetwork --network-alias "myserver.com" \
|
||||||
mycontainer
|
mycontainer
|
||||||
|
|
||||||
If you need more features like **systemd interation** and **dns forwarding** please check [resolvable](https://hub.docker.com/r/mgood/resolvable/)
|
If you need more features like **systemd integration** and **dns forwarding** please check [resolvable](https://hub.docker.com/r/mgood/resolvable/)
|
||||||
|
|
||||||
Any contribution is, of course, welcome. :)
|
Any contribution is, of course, welcome. :)
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,6 @@ def get_container_data(dockerClient, container_id):
|
||||||
container_hostname = info["Config"]["Hostname"]
|
container_hostname = info["Config"]["Hostname"]
|
||||||
container_name = info["Name"].strip("/")
|
container_name = info["Name"].strip("/")
|
||||||
container_ip = info["NetworkSettings"]["IPAddress"]
|
container_ip = info["NetworkSettings"]["IPAddress"]
|
||||||
if info["Config"]["Domainname"]:
|
|
||||||
container_hostname = container_hostname + "." + info["Config"]["Domainname"]
|
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
|
|
@ -106,8 +104,7 @@ def update_hosts_file():
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#remove all the trailing newlines on the line list
|
#remove all the trailing newlines on the line list
|
||||||
if lines:
|
while lines[-1].strip()=="": lines.pop()
|
||||||
while lines[-1].strip()=="": lines.pop()
|
|
||||||
|
|
||||||
#append all the domain lines
|
#append all the domain lines
|
||||||
if len(hosts)>0:
|
if len(hosts)>0:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue