Closed alexanderfichel closed 9 years ago
I would really recommend you use the container: docker run registry
About the exception here, your environment vars are probably not taken into account.
Put them in a script with your docker-registry launch command, and call that script instead is a solution.
Well I was trying to learn the registry, its easier without the docker container overhead, plus I used all the installation steps from the dockerfile anyway. But my question is where does this command "docker-registry" come from. Because when I run it, it tells me to set the env variables.
ubuntu@ip-10-232-1-123:/$ docker-registry -h
usage: docker-registry [-h]
run the docker-registry with gunicorn, honoring the following
environment variables:
REGISTRY_HOST: TCP host or ip to bind to; default is 0.0.0.0
REGISTRY_PORT: TCP port to bind to; default is 5000
GUNICORN_WORKERS: number of worker processes gunicorn should start
GUNICORN_GRACEFUL_TIMEOUT: timeout in seconds for graceful worker restart
GUNICORN_SILENT_TIMEOUT: timeout in seconds for restarting silent workers
GUNICORN_USER: unix user to downgrade priviledges to
GUNICORN_GROUP: unix group to downgrade priviledges to
GUNICORN_ACCESS_LOG_FILE: File to log access to
GUNICORN_ERROR_LOG_FILE: File to log errors to
GUNICORN_OPTS: extra options to pass to gunicorn
optional arguments:
-h, --help show this help message and exit
And here are my env variables.
$ env
GUNICORN_OPTS=[--preload]
XDG_SESSION_ID=1
TERM=xterm
SHELL=/bin/bash
DOCKER_REGISTRY_CONFIG=/usr/local/lib/python2.7/dist-packages/config/config.yml
SSH_CLIENT=10.234.68.88 1711 22
SSH_TTY=/dev/pts/0
AWS_BUCKET=itmcc-docker-registry-backend
USER=ubuntu
GUNICORN_ACCESS_LOG_FILE=/var/log/docker-registry/access.log
LS_COLORS=...
MAIL=/var/mail/ubuntu
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
AWS_KEY=******************
PWD=/
LANG=en_US.UTF-8
GUNICORN_ERROR_LOG_FILE=/var/log/docker-registry/server.log
SHLVL=1
HOME=/home/ubuntu
SETTINGS_FLAVOR=prod
LOGNAME=ubuntu
SSH_CONNECTION=10.234.68.88 1711 10.232.1.123 22
LESSOPEN=| /usr/bin/lesspipe %s
AWS_SECRET=******************************
XDG_RUNTIME_DIR=/run/user/1000
LESSCLOSE=/usr/bin/lesspipe %s %s
_=/usr/bin/env
OLDPWD=/var/log/docker-registry
which docker-registry
should give you the location.
The output does NOT look like the official command - is this a wrapper script from your distro?
And because of the way you launch it (with sudo) your environment is NOT honored.
I followed the directions here (https://github.com/docker/docker-registry/blob/master/ADVANCED.md)and used: pip install docker-registry
It is definitely not any custom wrapper script, unless pip install docker-registry pulls from somewhere else other than the official docker-registry.
So, can you copy the output of which docker-registry
?
Than copy the output of cat $(which docker-registry)
Either way, about your issue, like suggested, make sure your environment is copied (eg: put your export in a script along with your docker-registry invocation).
Yup it was the sudo thing! Sorry I am kind of new to linux.
The output I get is:
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'docker-registry==0.9.1','console_scripts','docker-registry'
__requires__ = 'docker-registry==0.9.1'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('docker-registry==0.9.1', 'console_scripts', 'docker-registry')()
)
I am having trouble starting the private docker registry on my ubuntu ec2 instance (I will post the problem I am having down below, first ill describe how I installed it).
I installed it the following way:
In config.yml, point to new dir for .db file and change storage path
Then I set my env variables:
Btw: export GUNICORN_OPTS=[--preload] was the recommended workaround according to issue: https://github.com/docker/docker-registry/issues/870
Then I run:
And get this error:
No logs are generated in /var/log/docker-registry folder. Also I cannot for the life of me find how the command -> "docker-registry" is installed and where I can find it. I would really appreciate any help I can get here!