如何找到Docker REST API URL? [英] How do I find the Docker REST API URL?

查看:419
本文介绍了如何找到Docker REST API URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为Jenkins安装了Docker build step插件.

文档告诉我:

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)?

解决方案

如果您使用的是Linux,并且需要连接到本地计算机上的Docker API,则其URL可能是unix:///var/run/docker.sock,就像文档中提到的那样: 使用Docker引擎SDK和API进行开发

默认情况下,Docker守护程序在unix:///var/run/docker.sock上进行侦听,并且客户端必须具有root访问权限才能与该守护程序进行交互.如果您的系统上存在一个名为docker的组,则docker将套接字的所有权应用于该组.

如果您从 JetBrains IDE 连接到Docker,这可能会有所帮助. /p>

I have installed the Docker build step plugin for Jenkins.

The documentation is telling me:

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)

How can I find my URL to the REST API (I have Docker installed on my host)?

解决方案

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

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.

This might be helpful if you are connecting to Docker from a JetBrains IDE.

这篇关于如何找到Docker REST API URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆