Skip to content

Commit

Permalink
Use --label to set labels
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoRoth committed Dec 19, 2021
1 parent 3745e27 commit 0acfae3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tljh_repo2docker/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 0acfae3

Please sign in to comment.