Skip to content

Commit

Permalink
docker-push: add registry option
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonadoni committed Oct 24, 2023
1 parent f30be8e commit f2250ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions reana/reana_dev/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,11 @@ def docker_rmi(user, tag, component): # noqa: D301
default=["CLUSTER"],
help="Which components? [name|CLUSTER]",
)
@click.option(
"--registry", "-r", default="docker.io", help="Registry to use in the image tag"
)
@docker_commands.command(name="docker-push")
def docker_push(user, tag, component): # noqa: D301
def docker_push(user, tag, component, registry): # noqa: D301
"""Push REANA component images to DockerHub.
\b
Expand Down Expand Up @@ -293,7 +296,7 @@ def docker_push(user, tag, component): # noqa: D301
if is_component_dockerised(component):
if tag == "auto":
component_tag = get_docker_tag(component)
cmd = "docker push {0}/{1}:{2}".format(user, component, component_tag)
cmd = f"docker push {registry}/{user}/{component}:{component_tag}"
run_command(cmd, component)
else:
msg = "Ignoring this component that does not contain" " a Dockerfile."
Expand Down

0 comments on commit f2250ab

Please sign in to comment.