docker 注册表推送错误

docker registry push error

我尝试在本地使用 AWS S3 配置启动 docker 注册表。

环境

Docker 信息

Containers: 10
Images: 30
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 50
 Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.13.0-66-generic
Operating System: Ubuntu 14.04.3 LTS
CPUs: 1
Total Memory: 1.955 GiB
Name: vagrant-ubuntu-trusty-64

我使用以下命令启动了 docker 注册表。

$ docker run \
     -e SETTINGS_FLAVOR=s3 \
     -e AWS_BUCKET=<my AWS_BUCKET>
     -e STORAGE_PATH=/registry \
     -e AWS_KEY=<my AWS_KEY> \
     -e AWS_SECRET=<my AWS_SECRET> \
     -e SEARCH_BACKEND=sqlalchemy \
     -p 5000:5000 \
     registry

然后我推送了自己的 ubuntu 图片。

$ docker push 127.0.0.1:5000/ubuntu

然后我得到了下面的结果。

3fd0c2ae8ed2: Pushing [==================================================>] 

196.8 MB/196.8 MB

Received HTTP code 500 while uploading layer: "<!DOCTYPE HTML PUBLIC \"-  
`//W3C//DTD HTML 3.2 Final//EN\">\n<title>500 Internal Server 
Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an 
internal error and was unable to complete your request.  Either the server
is overloaded or there is an error in the application.</p>\n"`

所以你能检查一下我的配置是否有误吗?

我建议您改用 docker 注册 v2。

像这样:

docker run \
     -e SETTINGS_FLAVOR=s3 \
     -e AWS_BUCKET=<my AWS_BUCKET>
     -e STORAGE_PATH=/registry \
     -e AWS_KEY=<my AWS_KEY> \
     -e AWS_SECRET=<my AWS_SECRET> \
     -e SEARCH_BACKEND=sqlalchemy \
     -p 5000:5000 \
     registry:2

此外,尝试使用 config.yml 方法,config.ymlhere's an examples3

可以找到配置的完整列表here。检查 s3 相关选项的存储部分。