Bug 1311452 - The docker registry does not work well with special volume
Summary: The docker registry does not work well with special volume
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Image Registry
Version: 3.x
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Paul Weil
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-24 09:52 UTC by zhou ying
Modified: 2016-10-09 09:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 17:10:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhou ying 2016-02-24 09:52:52 UTC
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 15:23:11 UTC
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 08:45:09 UTC
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.