🐛 fix running on mac
This commit is contained in:
parent
8a429b1609
commit
e6639c8fe2
19
Dockerfile
19
Dockerfile
|
|
@ -1,11 +1,16 @@
|
||||||
FROM docker.io/library/python:3-alpine
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
|
ARG BASE_IMAGE=docker.io/library/python:3-alpine
|
||||||
|
ARG APP_DIR=/hoster
|
||||||
|
|
||||||
|
FROM ${BASE_IMAGE}
|
||||||
|
|
||||||
RUN pip3 install docker
|
RUN pip3 install docker
|
||||||
RUN mkdir /hoster
|
|
||||||
WORKDIR /hoster
|
ARG APP_DIR=/hoster
|
||||||
ADD hoster.py /hoster/
|
WORKDIR ${APP_DIR}
|
||||||
|
|
||||||
|
ADD hoster.py ./
|
||||||
|
|
||||||
CMD ["python3", "-u", "hoster.py"]
|
CMD ["python3", "-u", "hoster.py"]
|
||||||
|
# CMD "whoami"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
# This file replaces `docker build -t docker-hoster .`
|
||||||
|
# Run this with `docker-compose build`
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
host-hostnames:
|
||||||
|
container_name: 'host-hostnames'
|
||||||
|
build:
|
||||||
|
context: '.'
|
||||||
|
volumes:
|
||||||
|
- '/var/run/docker.sock:/tmp/docker.sock:ro'
|
||||||
|
- '/etc/hosts:/tmp/hosts'
|
||||||
|
|
@ -125,7 +125,7 @@ def update_hosts_file():
|
||||||
aux_hosts.writelines(lines)
|
aux_hosts.writelines(lines)
|
||||||
|
|
||||||
#replace etc/hosts with aux file, making it atomic
|
#replace etc/hosts with aux file, making it atomic
|
||||||
shutil.move(aux_file_path, hosts_path)
|
shutil.copyfile(aux_file_path, hosts_path)
|
||||||
|
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue