Add support for skopeo copy

This change fixes the API to support skopeo that except status code 201
on creation.

Change-Id: I28e4ca5c19f935d0ecbf916d5f89fbb4ca068c19
This commit is contained in:
Tristan Cacqueray 2019-10-04 17:55:02 +00:00 committed by James E. Blair
parent a6ebe80fc4
commit 6722875907
3 changed files with 20 additions and 1 deletions

View File

@ -54,3 +54,15 @@
- name: Print list of images
command: docker image ls --all --digests --no-trunc
- name: Create a local containers/image
shell: buildah commit --rm $(buildah from scratch) local-test
- name: Check the local image is there
command: skopeo inspect containers-storage:localhost/local-test:latest
- name: Copy the local image to the registry
command: >
skopeo copy --dest-creds testuser:testpass --dest-tls-verify=false
containers-storage:localhost/local-test:latest
docker://127.0.0.1:9000/test

View File

@ -8,11 +8,18 @@
workspace: /tmp/registry-test
local: false
tasks:
- name: Add project atomic PPA
apt_repository:
repo: ppa:projectatomic/ppa
become: true
- name: Install packages
package:
name:
- docker-compose
- openssl
- skopeo
- buildah
state: present
become: true
- name: Run main tasks

View File

@ -172,7 +172,7 @@ class RegistryAPI:
res.headers['Location'] = '/v2/%s/blobs/%s' % (repository, digest)
res.headers['Docker-Content-Digest'] = digest
res.headers['Content-Range'] = '%s-%s' % (old_length, new_length)
res.status = '204 No Content'
res.status = '201 Created'
@cherrypy.expose
@cherrypy.config(**{'tools.auth_basic.checkpassword': require_write})