Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker pull attempt when missing Dockerfile #333

Merged
merged 1 commit into from
Oct 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions planemo_ext/galaxy/tools/deps/docker_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ def build_save_image_command(
build_command_parts.extend(["save", "-o", destination, image])
return build_command_parts

def build_pull_command(
tag,
**kwds
):
build_command_parts = __docker_prefix(**kwds)
build_command_parts.extend(["pull", tag])
return build_command_parts

def build_docker_cache_command(
image,
Expand Down
17 changes: 11 additions & 6 deletions planemo_ext/galaxy/tools/deps/dockerfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ def dockerfile_build(path, dockerfile=None, error=log.error, **kwds):
image_identifier = expected_container_names.pop()

dockerfile = __find_dockerfile(dockerfile, tool_directories)
docker_command_parts = docker_util.build_command(
image_identifier,
dockerfile,
**docker_host_args(**kwds)
)
if dockerfile is not None:
docker_command_parts = docker_util.build_command(
image_identifier,
dockerfile,
**docker_host_args(**kwds)
)
else:
docker_command_parts = docker_util.build_pull_command(image_identifier, **docker_host_args(**kwds))
commands.execute(docker_command_parts)

commands.execute(docker_command_parts)
docker_image_cache = kwds['docker_image_cache']
if docker_image_cache:
Expand All @@ -67,4 +72,4 @@ def __find_dockerfile(dockerfile, tool_directories):
potential_dockerfile = os.path.join(directory, "Dockerfile")
if os.path.exists(potential_dockerfile):
return potential_dockerfile
raise Exception("Could not find dockerfile to build.")
return None