useradd docker mkdir -p /home/docker_registry chown -R docker.docker /home/docker_registry/
git clone https://github.com/docker/docker-registry.git cd docker-registry/config cp config_sample.yml config.yml
#配置sqlite数据库位置 sqlalchemy_index_database: _env:SQLALCHEMY_INDEX_DATABASE:sqlite:////home/docker_registry/docker-registry.db #配置本地存储位置 local: &local storage: local storage_path: _env:STORAGE_PATH:/home/docker_registry
apt-get update apt-get install build-essential python-dev liblzma-dev libevent-dev python-pip libssl-dev
vim /etc/hosts 127.0.0.1 docker.registry.com
apt-get install nginx #配置Nginx config vim /etc/nginx/nginx.conf
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
upstream docker-registry {
server localhost:5000;
}
server {
listen 80;
server_name docker.registry.com;
proxy_set_header Host $http_host; # required for docker client's sake
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
client_max_body_size 0; # disable any limits to avoid HTTP 413 for large image uploads
# required to avoid HTTP 411: see Issue #1486 (https://github.com/dotcloud/docker/issues/1486)
chunked_transfer_encoding on;
#
location / {
proxy_pass http://docker-registry;
}
}
}
cd /opt/docker-registry pip install .
pip install -i http://pypi.v2ex.com/simple . #注销下面的 pip install . 安装全部 --pip install -i http://pypi.v2ex.com/simple gunicorn
[program:docker-registry] directory=/opt/docker-registry #使用docker用户 user=docker command=/usr/local/bin/gunicorn --access-logfile - --error-logfile - -k gevent -b 0.0.0.0:5000 -w 8 --max-requests 100 --graceful-timeout 3600 -t 3600 docker_registry.wsgi:application redirect_stderr=true stderr_logfile=none stdout_logfile=/var/log/supervisor/docker-registry.log autostart=true autorestart=true
#重新加载 supervisor 配置: supervisorctl supervisor> reread docker-registry: available supervisor> update docker-registry: added process group supervisor> status docker-registry RUNNING pid 4371, uptime 0:00:01
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有