如何找到 Docker REST API URL? [英] How do I find the Docker REST API URL?
问题描述
我已经为 Jenkins 安装了 Docker 构建步骤插件.
I have installed the Docker build step plugin for Jenkins.
文档告诉我:
Name : Choose a name for this Docker cloud provider
Docker URL: The URL to use to access your Docker server API (e.g: http://172.16.42.43:4243)
如何找到 REST API 的 URL(我的主机上安装了 Docker)?
How can I find my URL to the REST API (I have Docker installed on my host)?
推荐答案
如果你在 Linux 上需要连接到本地机器上的 Docker API,它的 URL 可能是 unix:///var/run/docker.sock
,就像文档中提到的:开发Docker 引擎 SDK 和 API
If you are on Linux and need to connect to Docker API on the local machine, its URL is probably unix:///var/run/docker.sock
, like it is mentioned in documentation: Develop with Docker Engine SDKs and API
默认情况下,Docker 守护进程侦听 unix:///var/run/docker.sock
并且客户端必须具有 root 访问权限才能与守护进程交互.如果您的系统上存在名为 docker 的组,则 docker 会将套接字的所有权应用于该组.
By default the Docker daemon listens on
unix:///var/run/docker.sock
and the client must have root access to interact with the daemon. If a group named docker exists on your system, docker applies ownership of the socket to the group.
如果您从 JetBrains IDE 连接到 Docker,这可能会有所帮助.
This might be helpful if you are connecting to Docker from a JetBrains IDE.
这篇关于如何找到 Docker REST API URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!