Bug 1311452 - The docker registry does not work well with special volume
The docker registry does not work well with special volume
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Image Registry (Show other bugs)
3.x
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Paul Weil
Wei Sun
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-24 04:52 EST by zhou ying
Modified: 2016-10-09 05:06 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-12 13:10:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description zhou ying 2016-02-24 04:52:52 EST
Description of problem:
The docker registry does not work well with special volume

Version-Release number of selected component (if applicable):
openshift v1.1.3-194-gbe12c82
kubernetes v1.2.0-alpha.7-703-gbc4550d
etcd 2.2.5

How reproducible:
Always

Steps to Reproduce:
1. Start OpenShift;
2. Create integrated docker registry with special volume:
`oadm registry --create --credentials=openshift.local.config/master/openshift-registry.kubeconfig --config=openshift.local.config/master/admin.kubeconfig  --volume='/registrytest'`
3. Login OpenShift and do STI build
Actual results:


Expected results:
3. The build will failed with error:Failed to push image. Response from registry is: Received unexpected HTTP status: 500 Internal Server Error

Check the registry's log, has error too:
time="2016-02-24T03:09:05.564311255Z" level=error msg="response completed with error" err.code=UNKNOWN err.detail="filesystem: mkdir /registry/docker: permission denied" err.message="unknown error" go.version=go1.4.2 http.request.host="172.30.56.122:5000" http.request.id=40b90277-65f5-4b7c-9bb3-3ae6482988f6 http.request.method=POST http.request.remoteaddr="172.18.8.43:49950" http.request.uri="/v2/zhouyt/origin-ruby-sample/blobs/uploads/" http.request.useragent="docker/1.8.2-el7 go/go1.4.2 kernel/3.10.0-229.7.2.el7.x86_64 os/linux arch/amd64" http.response.contenttype="application/json; charset=utf-8" http.response.duration=164.2573ms http.response.status=500 http.response.written=156 instance.id=6ab02965-bc4a-4dba-8d9f-298398055696 vars.name="zhouyt/origin-ruby-sample"

Additional info:
The registry with special volume works well .
Comment 1 Paul Weil 2016-02-24 10:23:11 EST
Using --volume means that you're trying to change the default directory for storage.  This should be accompanied by a change in the config.yaml for the image or a change in the deployment config to add the env var 

- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
          value: /registrytest

otherwise, it will continue to try to use the default /registry as the basedir and it will not be mounted as an emptydir volume which includes the correct write permissions.  That is what is giving the "permission denied" error.
Comment 2 zhou ying 2016-02-25 03:45:09 EST
Hi Paul:
  Thanks ! 
  I add the env var by:
`oc env dc/docker-registry  REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/registrytest` works well . Will update the cases.

Note You need to log in before you can comment on or make changes to this bug.