Docker remote API
Docker remote API
该教程基于Ubuntu或Debian环境,如果不是,请略过本文
Docker API
在Docker生态系统中一共有三种API
- Registry API:提供了与来存储Docker镜像的Docker Registry集成的功能
- Docker Hub API:提供了与Docker Hub集成的功能
- Docker Remote API:提供与Docker守护进程进行集成的功能
其中, Docker Remote API是最常用的
启动Remote API
Remote API是由Docker守护进程提供的。因此我们在启动Docker守护进程时
,需要给Docker守护进程传递一个-H标志即可做到
- Ubuntu或Debian系统:
/etc/default/docker
- 对于Red Hat、 Redora及相关发布版本
/etc/sysconfig/docker
在该配置文件中添加:
OPTIONS='-H=tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock'
重启Docker守护进程:
systemctl stop docker
systemctl start docker
现在我们可以从一台远程主机来访问Docker守护进程:
docker -H docker.example.com:2375 info
测试Docker Remote API
curl http://docker.example.com:2375/info
返回JSON结果
通过API来管理Docker镜像
curl http://docker.example.com:2375/images/json | python -mjson.tool
通过API来管理Docker容器
curl -s http://docker.example.com:2375/containers/json | python -mjson.tool
References:
Docker remote API的更多相关文章
- Docker入门教程(八)Docker Remote API
Docker入门教程(八)Docker Remote API [编者的话]DockerOne组织翻译了Flux7的Docker入门教程,本文是系列入门教程的第八篇,重点介绍了Docker Remote ...
- 【转+自己研究】新姿势之Docker Remote API未授权访问漏洞分析和利用
0x00 概述 最近提交了一些关于 docker remote api 未授权访问导致代码泄露.获取服务器root权限的漏洞,造成的影响都比较严重,比如 新姿势之获取果壳全站代码和多台机器root权限 ...
- Docker remote API简单配置使用
1.启动docker remote API的方式如下: docker -d -H uninx:///var/run/docker.sock -H tcp://0.0.0.0:5678 2.但是为了伴随 ...
- 关于docker remote api未授权访问漏洞的学习与研究
漏洞介绍: 该未授权访问漏洞是因为docker remote api可以执行docker命令,从官方文档可以看出,该接口是目的是取代docker 命令界面,通过url操作docker. docker ...
- [Shell]Docker remote api未授权访问漏洞(Port=2375)
0x01 简介 该未授权访问漏洞是因为docker remote api可以执行docker命令,从官方文档可以看出,该接口是目的是取代docker 命令界面,通过url操作docker. Docke ...
- docker remote api enable in ubuntu
现在使用docker作为开发环境,操作系统是ubuntu16.10,pycharm中使用remote interpreter,需要用到remote api,结果发现自己的原答案是针对ubuntu 14 ...
- Docker Remote API v1.24
1. Brief introduction The Remote API has replaced rcli. The daemon listens on unix:///var/run/docker ...
- docker remote api 的安全隐患
开启docker的api,首先要知道docker的守护进程daemon,在下认为daemon作为Client和service连接的一个桥梁,负责代替将client的请求传递给service端. 默认情 ...
- Docker Remote API使用准备
1 修改配置文件 CentOS: /etc/sysconfig/docker Ubuntu: /etc/init/docker.conf 1.添加: DOCKER_OPTS='-H tcp://0.0 ...
随机推荐
- springboot拦截器拦了静态资源css,js,png,jpeg,svg等等静态资源
1.在SpringBoot中自己写的拦截器,居然把静态资源也拦截了,导致了页面加载失败. package com.bie.config; import com.bie.component.MyLoca ...
- OWIN详细介绍
1.OWIN.dll介绍 用反编译工具打开Owin.dll,你会发现类库中就只有一个IAppBuilder接口,所以说OWIN是针对.NET平台的开放Web接口. public interface I ...
- Python - 列表 - 第八天
Python 列表 序列是Python中最基本的数据结构.序列中的每个元素都分配一个数字 - 它的位置,或索引,第一个索引是0,第二个索引是1,依此类推. Python有6个序列的内置类型,但最常见的 ...
- Python基础18
“为什么有列表,还要元组?” 1. 元组可看成是简单的对象组合,而列表是随时间改变的数据集合. 2. 元组的不可变特性提供了某种完整性,确保元组不会被另一个引用来修改.类似于其它语言中的常数声明.
- 学习shiro第一天
shiro是一个强大而且易用的安全框架(主要包括认证和授权),它比spring security更加简单,而且它不依赖于任何容器,可以和许多框架集成. shiro的核心是安全管理器(SecurityM ...
- 多版本切换python
Python 安装包去官网自行下载: https://www.python.org/downloads/mac-osx/ Mac os 自带python, 但我记得是python2.7版本 在选择安装 ...
- 多线程学习笔记(一) InvokeRequired 和 delegate
入门示例: 假如有一个label,我们希望像走马灯一样,从1显示到100 private void button1_Click(object sender, EventArgs e) { ; i &l ...
- tushare库:免费的python财经数据接口
tushare官网以及在线文档http://tushare.org/ 安装 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tus ...
- odoo10学习笔记十:Actions
转载请注明原文地址:https://www.cnblogs.com/ygj0930/p/11189319.html actions定义了系统对于用户的操作的响应:登录.按钮.选择项目等. 一:窗口ac ...
- Tests in error:BlogApplicationTests.initializationError » IllegalState Unable to find a @Spri...【解决】
刚刚写完一个项目,准备打包,却发现无法打包. 然后认真排查了一下问题.发现少引入了一个插件. <plugin> <groupId>org.apache.maven.plugin ...