Don't publish port / bind mount inside CircleCI

The remote docker endpoint we have does
not support doing bind mounts from the
CircleCI Host. We also can not access
the published external network port, so
let's sotp doing that.
This commit is contained in:
yuvipanda
2018-07-11 02:15:47 -07:00
parent 732ca48887
commit 0b938f7b9b

View File

@@ -14,17 +14,12 @@ def build_systemd_image(image_name, source_path):
])
def run_systemd_image(image_name, container_name, external_port, source_path):
def run_systemd_image(image_name, container_name):
"""
Run docker image with systemd
Image named image_name should be built with build_systemd_image.
source_path is mounted to /srv/src in the container, so all changes to the
source are reflected in the host.
Port 80 inside the container is made available to the host at external_port.
Container named container_name will be started.
"""
subprocess.check_call([
@@ -32,8 +27,6 @@ def run_systemd_image(image_name, container_name, external_port, source_path):
'--privileged',
'--detach',
'--name', container_name,
'--publish', f'{external_port}:80',
'--mount', f'type=bind,source={source_path},target=/srv/src',
image_name
])
@@ -99,7 +92,7 @@ def main():
if args.action == 'build-image':
build_systemd_image(image_name, source_path)
elif args.action == 'start-container':
run_systemd_image(image_name, container_name, 12000, source_path)
run_systemd_image(image_name, container_name)
elif args.action == 'stop-container':
remove_systemd_container(container_name)
elif args.action == 'run':