简体   繁体   中英

docker registry push error

I tried to launch docker registry with AWS S3 configuration in local.

Environment

  • OS: ubuntu trusty64
  • Docker: 1.7.1 ~ 1.8.3
  • Docker registry version: 0.9.1 ~ 2.1.1

Docker info

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

I launched the docker registry with commands below.

$ 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

And I pushed my own ubuntu image.

$ docker push 127.0.0.1:5000/ubuntu

Then I got the result below.

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"`

So could you check whether my configuration is wrong or not?

I'd suggest you use the docker register v2 instead.

Like this:

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

Also, try use the config.yml approach, here's an example of config.yml with s3 .

Full list of the configuration can be found here . Check the storage section for s3 related options.

I'm assuming that you are using docker s3 storage driver. First thing to check if you have permissions to upload to that bucket. Install aws-cli and try using those credentials to upload test file see if that works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM