Skip to content

Commit

Permalink
fix: Add non-interactive Docker build flags to prevent stuck prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCuadron committed Feb 17, 2025
1 parent 30e39e8 commit a6f3035
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions openhands/runtime/builder/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,18 @@ def build(
target_image_repo, target_image_source_tag = target_image_hash_name.split(':')
target_image_tag = tags[1].split(':')[1] if len(tags) > 1 else None

# Set environment variables for non-interactive Docker builds
os.environ['DOCKER_BUILDKIT'] = '1'
os.environ['DOCKER_SCAN_SUGGEST'] = 'false'
os.environ['DEBIAN_FRONTEND'] = 'noninteractive'

buildx_cmd = [
'docker',
'buildx',
'build',
'--progress=plain',
'--force-rm', # Force remove intermediate containers
'--rm', # Remove intermediate containers after a successful build
f'--build-arg=OPENHANDS_RUNTIME_VERSION={oh_version}',
f'--build-arg=OPENHANDS_RUNTIME_BUILD_TIME={datetime.datetime.now().isoformat()}',
f'--tag={target_image_hash_name}',
Expand Down

0 comments on commit a6f3035

Please sign in to comment.