小编jtb*_*lin的帖子

查看docker公共注册表中是否存在图像的规范方法是什么?

我们想在开始部署之前自动检查公共注册中心(Docker Hub)中是否存在图像.使用v1 API,我们只会查询https://index.docker.io/v1/repositories/gliderlabs/alpine/tags/3.2示例.

但是现在注册表的官方API是v2,检查公共注册表中图像是否存在的官方方法是什么?

V1

$ curl -i https://index.docker.io/v1/repositories/gliderlabs/alpine/tags/latest
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Tue, 11 Aug 2015 10:02:09 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Vary: Cookie
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=31536000

[{"pk": 20307475, "id": "5bd56d81"}, {"pk": 20355979, "id": "511136ea"}]
Run Code Online (Sandbox Code Playgroud)

v2:

$ curl -i https://index.docker.io/v2/repositories/gliderlabs/alpine/tags/latest
HTTP/1.1 301 MOVED PERMANENTLY
Server: nginx/1.6.2
Date: Tue, 11 Aug 2015 10:04:20 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
X-Frame-Options: SAMEORIGIN
Location: https://index.docker.io/v2/repositories/gliderlabs/alpine/tags/latest/
Strict-Transport-Security: max-age=31536000

$ curl -i https://index.docker.io/v2/repositories/gliderlabs/alpine/tags/latest/
HTTP/1.1 301 MOVED …
Run Code Online (Sandbox Code Playgroud)

docker dockerhub docker-registry

9
推荐指数
1
解决办法
3211
查看次数

无法使用boot2docker连接到作为容器运行的redis

在我的MBP上,boot2docker安装了最新版本,我有以下内容Dockerfile:

FROM redis:3.0.3
CMD redis-server --bind 0.0.0.0
Run Code Online (Sandbox Code Playgroud)

我执行以下操作:

docker build .
docker run --rm ba09b207db42 # where ba09b207db42 is the container id returned by the build command
Run Code Online (Sandbox Code Playgroud)

然后我跑:

redis-cli -h `boot2docker ip`
Run Code Online (Sandbox Code Playgroud)

我收到错误:

无法连接到Redis 192.168.59.103:6379:连接被拒绝

我错过了什么?

redis docker boot2docker

8
推荐指数
1
解决办法
2万
查看次数

kubectl -bash:_init_completion:找不到命令

无法kubectl在 Mac 上完成 bash。我bash-completionbrewie安装brew install bash-completion,然后按照安装说明,将其添加到~/.bash_profile

if [ -f $(brew --prefix)/etc/bash_completion ]; then . $(brew --prefix)/etc/bash_completion fi

kubectl -bash: _init_completion: command not found但重新获取配置文件后仍然出现错误。

macos bash-completion kubernetes

6
推荐指数
1
解决办法
4554
查看次数

如何使用 Influxdb 查询一段时间内有多少个指标?

我想知道在给定时间段内我们向 InfluxDB 发送了多少事件。如果我使用以下查询SELECT COUNT(value) FROM /./ WHERE time > now() - 1h GROUP BY time(10m),我会为每个指标分组,但我想要所有指标的总数。

如果我使用SELECT COUNT(*) FROM /./ WHERE time > now() - 1h GROUP BY time(10m),我会收到一个错误:

服务器返回错误:count() 中的预期字段参数

influxdb

1
推荐指数
1
解决办法
5752
查看次数