我正在尝试从Ubuntu 14.04.1上的源代码(而不是容器)构建docker-registry服务器。我能够使用digitalocean上的说明走完大部分的路。
我可以毫无问题地卷曲http://localhost:5000和https://user:password@localhost:8000
当我试图打开web浏览器,希望看到的不仅仅是这些,这时问题似乎就会发生。
下面是我在/etc/nginx/sites available/中的docker注册表文件:
# For versions of Nginx > 1.3.9 that include chunked transfer encoding support
# Replace with appropriate values where necessary
upstream docker-registry {
server 192.168.x.x:5000;
}
server {
listen 8000;
server_name docker-registry;
ssl on;
ssl_certificate /etc/nginx/ssl/docker-registry.crt;
ssl_certificate_key /etc/nginx/ssl/docker-registry.key;
proxy_set_header Host $http_host; # required for Docker client sake
X-Real-IP $remote_addr; # pass on real client IP
client_max_body_size 0; # disable any limits to avoid HTTP 413 for large image uploads
# required to avoid HTTP 411: see Issue #1486 (https://github.com/dotcloud/docker/issues/1486)
chunked_transfer_encoding on;
location / {
# let Nginx know about our auth file
auth_basic "Restricted";
auth_basic_user_file docker-registry.htpasswd;
proxy_pass http://docker-registry;
}
location /_ping {
auth_basic off;
proxy_pass http://docker-registry;
}
location /v1/_ping {
auth_basic off;
proxy_pass http://docker-registry;
}
}我将docker注册表存储在本地的/var/docker-registry中,并确保www-data用户可以读取它。为什么在web浏览器上看不到我的图像?
如果我标记一个图像并将其推送到我的存储库,它将正常工作,我可以在web浏览器中看到它:
https://192.168.x.x:8000/v1/repositories/ubuntu-test/tags/latest我看到以下几点:
"5ba9dab47459d81c0037ca3836a368a4f8ce5050505ce89720e1fb8839ea048a"当我试图到达:
https://192.168.x.x:8000/v1或者:
https://192.168.x.x:8000/v1/repositories或者:
https://192.168.x.x:8000/v1/images我得到一个“找不到”错误
我如何能够通过web界面查看我的/var/docker-registry文件夹中的所有内容(是的,它们属于www- stored....and用户)?
发布于 2015-11-25 01:42:23
这是设计好的。不仅没有理由实现整个url路径,而且实现它还会带来严重的安全隐患。
我假设你在web编程方面没有太多经验。没有目录'/v1/repositories'...取而代之的是,有一个程序(在本例中是Python或Ruby)监听url路径,并具有内置的逻辑来确定要做什么。
即,如果url = /v1/_ping:返回'ok‘
https://stackoverflow.com/questions/28587802
复制相似问题