From 0acfae3b6322512731c695695949b4b99905f04a Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Sun, 19 Dec 2021 02:42:34 +0100 Subject: [PATCH] Use --label to set labels --- tljh_repo2docker/docker.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tljh_repo2docker/docker.py b/tljh_repo2docker/docker.py index d2cdf45..6cbdd38 100644 --- a/tljh_repo2docker/docker.py +++ b/tljh_repo2docker/docker.py @@ -76,10 +76,10 @@ async def build_image( # add extra labels to set additional image properties labels = [ - f"LABEL tljh_repo2docker.display_name={name}", - f"LABEL tljh_repo2docker.image_name={image_name}", - f"LABEL tljh_repo2docker.mem_limit={memory}", - f"LABEL tljh_repo2docker.cpu_limit={cpu}", + f"tljh_repo2docker.display_name={name}", + f"tljh_repo2docker.image_name={image_name}", + f"tljh_repo2docker.mem_limit={memory}", + f"tljh_repo2docker.cpu_limit={cpu}", ] cmd = [ "jupyter-repo2docker", @@ -92,11 +92,16 @@ async def build_image( "--no-run", "--image-name", image_name, - "--appendix", - "\n".join(labels), - repo, ] + for label in labels: + cmd += [ + "--label", + label + ] + + cmd.append(repo) + config = { "Cmd": cmd, "Image": "quay.io/jupyterhub/repo2docker:main",