Skip to content

Commit

Permalink
Merge pull request #48 from TimoRoth/set_labels
Browse files Browse the repository at this point in the history
Use --label to set labels
  • Loading branch information
jtpio authored Dec 31, 2021
2 parents 3745e27 + 0acfae3 commit fe7d689
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 fe7d689

Please sign in to comment.