李明
|
通过vagrant 安装vagrant reload
下载Harbor
sudo yum -y install lrzsz#在windows下载的1.5.2 online 上传上去rz
tar xvf harbor-online-installer-v1.5.2.tgz
cd harbor sudo ./install.sh
sudo ./prepare
sudo docker-compose up -d
安装成功
sudo docker-compose stop
sudo docker-compose start
测试harbor
sudo serivce docker restartcd harbor sudo docker-compose start
sudo vi /etc/docker/daemon.json#写入{"insecure-registries":["172.28.128.6"]} sudo systemctl restart docker
#因为没配置http的过滤, 某人是使用https,就拒绝了。connect: connection refused#配置了上边的insecure-registriesserver gave HTTP response to HTTPS client
push 镜像试试
#这个错误,就是未建立项目。f9d9e4e6e2f0: Preparing denied: requested access to the resource is denied
sudo docker pull busybox sudo docker tag busybox 172.28.128.6/idig8/busybox sudo docker login 172.28.128.6 -u idig8 -p 123456789 sudo docker push 172.28.128.6/idig8/busybox
远程连接harbor
sudo systemctl status docker
sudo vi /usr/lib/systemd/system/docker.service
sudo systemctl daemon-reload sudo systemctl restart docker
sudo docker login http://172.28.128.6 -u admin -p Harbor12345 gitlab gitlab-ci harbor
stages: - style - test - deploy - release pep8: stage: style script: - pip install tox - tox -e pep8 tags: - python2.7 unittest-py27: stage: test script: - pip install tox - tox -e py27 tags: - python2.7unittest-py34: stage: test script: - pip install tox - tox -e py34 tags: - python3/4 docker-deploy: stage: deploy script: - docker build -t flask-demo . - if [ $( docker ps -aq --filter name=web) ]; then docker rm -f web;fi - docker run -d -p 5000:5000 --name web flask-demo tags: - test1 only: - masterdocker-image-release: stage: release script: - docker login 172.28.128.6 -u idig8 -p 123456789 - docker build -t 172.28.128.6/idig8/flask-demo:$CI_COMMIT_TAG . - docker login 172.28.128.6 -u idig8 -p 1qaz@WSX3edc - docker push 172.28.128.6/idig8/flask-demo:$CI_COMMIT_TAG tags: - test1 only: - tags
.
stages: - style - test - deploy - release pep8: stage: style script: - pip install tox - tox -e pep8 tags: - python2.7 except: - tags unittest-py27: stage: test script: - pip install tox - tox -e py27 tags: - python2.7 except: - tagsunittest-py34: stage: test script: - pip install tox - tox -e py34 tags: - python3/4 except: - tags docker-deploy: stage: deploy script: - docker build -t flask-demo . - if [ $( docker ps -aq --filter name=web) ]; then docker rm -f web;fi - docker run -d -p 5000:5000 --name web flask-demo tags: - test1 only: - master docker-image-release: stage: release script: - docker login 172.28.128.6 -u idig8 -p 123456789 - docker build -t 172.28.128.6/idig8/flask-demo:$CI_COMMIT_TAG . - docker login 172.28.128.6 -u idig8 -p 1qaz@WSX3edc - docker push 172.28.128.6/idig8/flask-demo:$CI_COMMIT_TAG tags: - test1 only: - tags
PS:实际上这个例子,就是特定版本的docker image的产生。一个版本的发布代表我们这个软件的稳定的版本的问世,接下来就可以进行对稳定版本的部署,我们对稳定版本的部署,稳定版本的部署具体是docker swarm还是k8s,最重要的是我们已经有了一个docker image,我们可以通过手动,或者自动的升级。update docker image 实现服务的不中断。 |
2018-11-01 10:09:55