Skip to content

Commit

Permalink
don't assing docker port
Browse files Browse the repository at this point in the history
  • Loading branch information
espenhgn committed Oct 2, 2024
1 parent 43a262c commit dfbbcd2
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/test_container_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@
"""

import os
import socket
import subprocess
import tempfile


# port used by tests
sock = socket.socket()
sock.bind(('', 0))
port = sock.getsockname()[1]

# Check that (1) singularity or apptainer executables exist,
# and (2) if not, check for docker.
# If neither are found, tests will fall back to plain python.
Expand All @@ -44,14 +38,14 @@
try:
runtime = 'docker'
out = subprocess.run(runtime, check=False)
PREFIX = (f'{runtime} run -p {port}:{port} ' +
PREFIX = (f'{runtime} run ' +
'ghcr.io/precimed/container_template python')
PREFIX_MOUNT = (
f'{runtime} run -p {port}:{port} ' +
f'{runtime} run ' +
f'--mount type=bind,source={cwd},target={cwd} ' +
'ghcr.io/precimed/container_template python')
PREFIX_CUSTOM_MOUNT = (
f'{runtime} run -p {port}:{port} ' +
f'{runtime} run ' +
f'--mount type=bind,source={cwd},target={cwd} ' +
'{custom_mount} ' +
'ghcr.io/precimed/container_template python')
Expand Down

0 comments on commit dfbbcd2

Please sign in to comment.