================================
配置不使用https链接pull镜像(ubuntu:/etc/default/docker)
#--------------------------------------------vsersion 1----------------------------------------
# Docker Upstart and SysVinit configuration file
# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"
# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4
--insecure-registry 10.0.0.0/16" #整个网段都可以不使用https
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"
# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"
#----------------------------------vsersion 2----------------------------------------------------
# Docker Upstart and SysVinit configuration file
# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"
# Use DOCKER_OPTS to modify the daemon startup options.
#配置自己默认地址
DOCKER_OPTS="$DOCKER_OPTS
--registry-mirror=http://b6056ba3.m.daocloud.io --dns 8.8.8.8 --dns 8.8.4.4 --insecure-registry 10.0.0.0/16"
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"
# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"
=======================================
docker-registry api
#查看所有仓库
curl -X GET http://10.0.99.2:5000/v1/search
curl -X GET http://10.0.99.2:5000/v1/search?q=cen //带上条件 cen
#列出某一仓库的的所有内容
curl -X GET http://10.0.99.2:5000/v1/repositories/library/centos/tags
#删除某个标签
curl -X DELETE http://10.0.99.2:5000/v1/repositories/library/centos7/tags/latest
#删除某个仓库
curl -X DELETE http://10.0.99.2:5000/v1/repositories/library/centos7/
#---------------------------------------------------------------------------------------------
#docker-registry API
IP="http://10.0.99.2:5000"
if [ $1 == 'search' ];then
curl -X GET $IP/v1/search #搜索所有仓库
fi
if [ $1 == 'tag-list' ];then
curl -X GET $IP/v1/repositories/$2/tags #列出某一个仓库的所有标签和image-id
fi
if [ $1 == 'delete' ];then
curl -X DELETE $IP/v1/repositories/$2/ #删除某一个仓库
fi
if [ $1 == 'tag-del' ];then
curl -X GET $IP/v1/repositories/$2/tags/$3 #删除某一个标签,但是该镜像还在硬盘上
fi
if [ $1 == 'tag-image-id' ];then
curl -X GET $IP/v1/repositories/$2/tags/$3 #取得某一镜像的image-id
fi
===========================================
#使用docker-registry
#启动docker-registry
docker run -d -e SETTINGS_FLAVOR=dev -e STORAGE_PATH=/tmp/registry -v
/root/app/docker-images-db:/tmp/registry -p 5000:5000 registry
docker run -d --name registry -e SETTINGS_FLAVOR=dev -e STORAGE_PATH=/tmp/registry -v /home/jamlee/app/docker-images-db:/tmp/registry -p 5000:5000 registry
#启动cadvisor
docker run --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --publish=8014:8080 --detach=true --name=cadvisor1 google/cadvisor:latest
===============================================================
#使用前端webui管理仓库
docker run \
-d \
-e ENV_DOCKER_REGISTRY_HOST=10.0.99.2 \
-e ENV_DOCKER_REGISTRY_PORT=5000 \
-p 8080:80 \
konradkleine/docker-registry-frontend