You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

请求详解JFrog Artifactory本地、远程与虚拟仓库的区别

Hey there, let me break down the three key repository types in JFrog Artifactory for you—each has a clear, distinct role, and understanding their use cases will make the whole setup click. Let’s dive in:

Local Repositories

Think of local repos as your team’s private storage locker for artifacts you own and control. These are entirely self-contained—nothing gets added here unless you or your CI/CD pipeline explicitly pushes it.

  • Core purpose: Store internal build artifacts (like your company’s custom Java JARs, npm packages, or Docker images), third-party artifacts you’ve licensed for private use, or any content you want to keep isolated from external sources.
  • Key traits: No external fetching happens here; you’re in full control of permissions, versions, and retention policies.
  • Example: When your GitHub Actions pipeline builds a new version of your internal microservice, it pushes the resulting Docker image directly to a local Docker repository in Artifactory. Only your engineering teams with access can pull this image for deployment.

Remote Repositories

Remote repos act as smart proxies and caches for external public repositories. They don’t store your own artifacts—instead, they fetch and cache content from public sources (like Maven Central, npm Registry, PyPI) when your team requests it.

  • Core purpose: Reduce external network dependency, speed up build times (by caching artifacts locally), and enforce governance over which external sources your team can access.
  • Key traits: When you request an artifact that’s not already cached, Artifactory pulls it from the configured remote source, stores a copy, and serves the cached version for all future requests. You can also configure proxy settings, block certain artifacts, or set expiration policies for cached content.
  • Example: You set up a remote Maven repository pointing to Maven Central. When your project needs org.springframework:spring-core:5.3.20, Artifactory checks if it has a cached copy—if not, it fetches it from Central, stores it, and serves it to your build. Next time someone else needs the same version, it’s served instantly from the cache.

Virtual Repositories

Virtual repos are unified entry points that aggregate multiple local and remote repositories into a single URL. They’re the "frontend" that your build tools (Maven, npm, Docker) interact with, so you don’t have to configure multiple repository URLs in your projects.

  • Core purpose: Simplify build configuration, enforce repository priority (e.g., check local repos first before reaching out to remote sources), and create logical groupings of repositories (like a "dev" virtual repo that includes all dev-focused local and remote repos).
  • Key traits: You can define the order in which Artifactory searches linked repositories. For example, you can set it to first look in your local production repo, then your local dev repo, then the remote Maven Central repo. This ensures your team always uses internal artifacts when available, falling back to external sources only when needed.
  • Example: You create a virtual Maven repo that combines your local internal-maven repo, remote maven-central repo, and remote jcenter repo. Your project’s pom.xml only needs to reference this single virtual repo URL. When building, Artifactory automatically searches all three underlying repos to find the required dependencies, following the priority order you set.

Quick Recap of How They Work Together

  • Local: Stores your team’s unique artifacts.
  • Remote: Proxies and caches external public artifacts.
  • Virtual: Gives your team one simple URL to access all relevant local and remote artifacts, streamlining your build workflow.

内容的提问来源于stack exchange,提问作者UCodeIT

火山引擎 最新活动