@nalan90
2017-08-29T15:59:35.000000Z
字数 800
阅读 644
Docker
创建docker-registry
docker run -itd --restart=always --name registry \
-p 5000:5000 -v /opt/data/registry:/var/lib/registry \
registry:2
创建docker-registry-ui
docker run -itd -p 8080:8080 --restart=always \
--name registry-web --link registry \
-e REGISTRY_URL=http://registry:5000/v2 \
-e REGISTRY_NAME=localhost:5000 \
hyper/docker-registry-web
WebUI (http://localhost:8080)
定义Dockerfile
FROM centos
RUN yum update && yum -y install vim
build image
## . 表示Dockerfile在当前路径下
## 若Dockerfile 在/home/test目录下,将 . 替换成/home/test即可
docker build -t docker.wlask.com/test/gateway-nginx-prod-master:latest .
tag image
## docker tag [souce image] [target image]
docker tag docker.wlask.com/test/php-prod-master:latest docker-publish.wlask.com/test/php-prod-master:latest
push image
## docker-publish.sunfund.com为私有仓库地址
docker push docker-publish.wlask.com/test/php-prod-master:latest