Skip to content

Conversation

@kundeng
Copy link

@kundeng kundeng commented Aug 11, 2025

Summary

• Fixes Docker network access issues on Linux preventing npm and JSR package downloads
• Adds --network=host to Deno routine containers for JSR registry access
• Adds network: host to dify-openai Docker build for npm registry access during builds

Test plan

  • Verify harbor ls works on Linux (JSR registry access)
  • Verify harbor up dify builds successfully without hanging on npm install
  • Test both fixes on Linux systems where Docker networking is more restrictive

Context

Docker on Linux uses bridge networking by default which can block container access to external package registries. This causes:

  • Harbor routines to fail when downloading JSR dependencies like @std/yaml
  • Dify builds to hang during npm install when building the dify-openai service

Both fixes apply the same solution (network: host) at different stages:

  1. Runtime network access for short-lived utility containers (routines)
  2. Build-time network access for Docker image builds

🤖 Generated with Claude Code

kundeng and others added 2 commits August 11, 2025 16:25
Harbor routines run in containerized Deno environment but couldn't access
JSR registry for downloading dependencies like @std/yaml. This caused
'harbor ls' and other commands to fail on Linux systems.

The fix adds --network=host to the Docker run command in run_routine(),
allowing containers to access external registries while maintaining
the same security model (short-lived utility containers with existing
filesystem access).

Fixes network connectivity issues when downloading JSR packages on
Linux systems where Docker's default bridge networking is more restrictive.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The dify-openai service builds a custom Docker image that runs 'npm install'
during the build process. On Linux systems, Docker's default bridge networking
can prevent build containers from accessing external package registries,
causing builds to hang or fail.

This fix adds 'network: host' to the build configuration, allowing the
build process to access npm registry during 'npm install'. This is similar
to the JSR network access fix for Deno routines but applies to Docker
build-time network access.

Resolves build hangs when running 'harbor up dify' on Linux systems
where npm install gets stuck accessing the npm registry.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant