Eigenes docker repository: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 2: Zeile 2:
 
*[[ubuntu paket von docker installieren| install from ubuntu-package from docker  ]]  
 
*[[ubuntu paket von docker installieren| install from ubuntu-package from docker  ]]  
 
=nginx install=
 
=nginx install=
* # apt-get install nginx git apache2-utils
+
* apt-get install nginx git apache2-utils
* # git clone https://github.com/docker/docker-registry  
+
* git clone https://github.com/docker/docker-registry  
* # cp docker-registry/contrib/nginx/nginx_1-3-9.conf /etc/nginx/conf.d/
+
* cp docker-registry/contrib/nginx/nginx_1-3-9.conf /etc/nginx/conf.d/
* # cp docker-registry/contrib/nginx/docker-registry.conf /etc/nginx/
+
* cp docker-registry/contrib/nginx/docker-registry.conf /etc/nginx/
  
 
=nginx add user=
 
=nginx add user=
* # touch /etc/nginx/docker-registry.htpasswd
+
* touch /etc/nginx/docker-registry.htpasswd
* # htpasswd -b /etc/nginx/docker-registry.htpasswd USERNAME-X PASSWORD-X  
+
* htpasswd -b /etc/nginx/docker-registry.htpasswd USERNAME-X PASSWORD-X  
* # htpasswd -b /etc/nginx/docker-registry.htpasswd USERNAME-Y PASSWORD-Y
+
* htpasswd -b /etc/nginx/docker-registry.htpasswd USERNAME-Y PASSWORD-Y
  
 
=get certifikates=
 
=get certifikates=
 
; there are many howtos ...  
 
; there are many howtos ...  
* # cat ca.pem >> /etc/ssl/certs/ca-certificates.crt
+
* cat ca.pem >> /etc/ssl/certs/ca-certificates.crt
* # cp server-cert.pem /etc/ssl/certs/docker-registry  
+
* cp server-cert.pem /etc/ssl/certs/docker-registry  
* # cp server-key.pem /etc/ssl/private/docker-registry  
+
* cp server-key.pem /etc/ssl/private/docker-registry  
* # sed -ie "s/my.docker.registry.com/yourhost.yourdomain.com/" /etc/nginx/conf.d/nginx_1-3-9.conf
+
* sed -ie "s/my.docker.registry.com/yourhost.yourdomain.com/" /etc/nginx/conf.d/nginx_1-3-9.conf
* # service nginx restart
+
* service nginx restart
  
 
=start docker registry=
 
=start docker registry=
Zeile 24: Zeile 24:
 
  GUNICORN_OPTS=[--preload] only important at the first start
 
  GUNICORN_OPTS=[--preload] only important at the first start
  
=der login=
+
=login=
 
* # docker login https://yourhost.yourdomain.com
 
* # docker login https://yourhost.yourdomain.com
 +
 
=image tagen=
 
=image tagen=
 
* # docker tag own-image yourhost.yourdomain.com/own-image
 
* # docker tag own-image yourhost.yourdomain.com/own-image

Aktuelle Version vom 10. Mai 2017, 18:56 Uhr

first steps

nginx install

  • apt-get install nginx git apache2-utils
  • git clone https://github.com/docker/docker-registry
  • cp docker-registry/contrib/nginx/nginx_1-3-9.conf /etc/nginx/conf.d/
  • cp docker-registry/contrib/nginx/docker-registry.conf /etc/nginx/

nginx add user

  • touch /etc/nginx/docker-registry.htpasswd
  • htpasswd -b /etc/nginx/docker-registry.htpasswd USERNAME-X PASSWORD-X
  • htpasswd -b /etc/nginx/docker-registry.htpasswd USERNAME-Y PASSWORD-Y

get certifikates

there are many howtos ...
  • cat ca.pem >> /etc/ssl/certs/ca-certificates.crt
  • cp server-cert.pem /etc/ssl/certs/docker-registry
  • cp server-key.pem /etc/ssl/private/docker-registry
  • sed -ie "s/my.docker.registry.com/yourhost.yourdomain.com/" /etc/nginx/conf.d/nginx_1-3-9.conf
  • service nginx restart

start docker registry

  • # docker run -d --name my-registry -e GUNICORN_OPTS=[--preload] -e STORAGE_PATH=/registry -p 127.0.0.1:5000:5000 -v /registry:/registry registry
GUNICORN_OPTS=[--preload] only important at the first start

login

image tagen

  • # docker tag own-image yourhost.yourdomain.com/own-image

image pushen(one host)

  • # docker push yourhost.yourdomain.com/own-image

image pull(other host)

  • # docker pull yourhost.yourdomain.com/own-image

links