Skip to content

Commit

Permalink
Remove intermediate containers and name os_detect images (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
stonier committed Mar 30, 2021
1 parent 4214d73 commit 80602eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rocker/os_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ def detect_os(image_name, output_callback=None, nocache=False):
return _detect_os_cache[image_name]

iof = StringIO((DETECTION_TEMPLATE % locals()).encode())
image_id = docker_build(fileobj = iof, output_callback=output_callback, nocache=nocache)
image_id = docker_build(
fileobj=iof,
output_callback=output_callback,
nocache=nocache,
forcerm=True, # Remove intermediate containers from RUN commands in DETECTION_TEMPLATE
tag="rocker:" + f"os_detect_{image_name}".replace(':', '_').replace('/', '_')
)
if not image_id:
if output_callback:
output_callback('Failed to build detector image')
Expand Down

0 comments on commit 80602eb

Please sign in to comment.