User Tools

Site Tools


технология_docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
технология_docker [2022/07/02 20:42]
val [docker-compose]
технология_docker [2022/07/15 12:19] (current)
val [Репозиторий]
Line 141: Line 141:
  
 touch /​var/​log/​webd.log touch /​var/​log/​webd.log
 +#chown 10003 /var/www/
   ​   ​
 if [ "​$MYMODE"​ = '​TEST'​ ]; then if [ "​$MYMODE"​ = '​TEST'​ ]; then
Line 157: Line 158:
 COPY start.sh / COPY start.sh /
 COPY webd /​usr/​local/​sbin/​webd COPY webd /​usr/​local/​sbin/​webd
-### ADD www.tgz /var/     ​#for simple test in k8s+### ADD www.tgz /var/          #for simple ​test in k8s 
 +###COPY index.html /​var/​www/ ​  #test in k8s
  
 EXPOSE 80 EXPOSE 80
Line 260: Line 262:
   webd:   webd:
     image: test/webd     image: test/webd
 +#    image: server.corp13.un:​5000/​student/​webd:​1.1
     build: webd/     build: webd/
     ports:     ports:
Line 293: Line 296:
 # docker-compose down # docker-compose down
  
-# docker-compose rm    #​Возможно,​ не требуется +# docker-compose rm
-</​code>​ +
-===== Дополнительные материалы =====+
  
-==== Локальный репозиторий ==== +# docker ​volume rm root_vol1
- +
- * [[https://​docs.docker.com/​registry/​|Docker Registry]] +
- +
-<​code>​ +
-gate# docker ​run -d -p 5000:5000 -v /​root:/​certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/​certs/​gate.crt -e REGISTRY_HTTP_TLS_KEY=/​certs/​gate.key --name registry registry:​2 +
- +
-node1# cp ~vagrant/​gate.crt /​etc/​docker/​certs.d/​gate.corp13.un\:​5000/​ca.crt +
- +
-node1# service docker restart +
- +
-node1# docker tag val/​webd:​latest gate.corp13.un:​5000/​webd +
- +
-node1# docker push gate.corp13.un:​5000/​webd +
- +
-node1# curl --insecure -X GET https://​gate.corp13.un:​5000/​v2/​_catalog +
-{"​repositories":​["​webd"​]}+
 </​code>​ </​code>​
  
-==== GitLab ​репозиторий ====+===== Локальные ​репозитории ===== 
 + 
 +==== Insecure Private Registry ​====
  
   * [[Инструмент GitLab#​GitLab Docker Registry]]   * [[Инструмент GitLab#​GitLab Docker Registry]]
 +  * [[https://​docs.docker.com/​registry/​insecure/​|Test an insecure registry/​Deploy a plain HTTP registry]]
  
 <​code>​ <​code>​
Line 333: Line 321:
 # docker login http://​server.corpX.un:​5000 # docker login http://​server.corpX.un:​5000
  
 +# less ~/​.docker/​config.json
 +</​code><​code>​
 +{
 +        "​auths":​ {
 +                "​server.corp13.un:​5000":​ {
 +                        "​auth":​ "​c3R1ZGVudDpwYXNzd29yZA=="​
 +                }
 +        }
 +}
 +</​code><​code>​
 # docker tag test/webd server.corpX.un:​5000/​student/​webd # docker tag test/webd server.corpX.un:​5000/​student/​webd
 # docker tag test/webd server.corpX.un:​5000/​student/​webd:​wwwdir # docker tag test/webd server.corpX.un:​5000/​student/​webd:​wwwdir
Line 339: Line 337:
 # docker push server.corpX.un:​5000/​student/​webd:​wwwdir # docker push server.corpX.un:​5000/​student/​webd:​wwwdir
 ... ...
-# docker run --name webd01 --hostname webd01 -itd -p 8000:80 server.corp13.un:​5000/​student/​webd:​wwwdir+# docker run --name webd01 --hostname webd01 -itd --rm -p 8000:80 server.corpX.un:​5000/​student/​webd 
 +</​code>​ 
 + 
 +==== Использование образа Docker Registry ==== 
 + 
 +  * [[https://​docs.docker.com/​registry/​|Docker Registry]] 
 + 
 +<​code>​ 
 +gate# docker run -d -p 5000:5000 -v /​root:/​certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/​certs/​gate.crt -e REGISTRY_HTTP_TLS_KEY=/​certs/​gate.key --name registry registry:​2 
 + 
 +node1# cp ~vagrant/​gate.crt /​etc/​docker/​certs.d/​gate.corp13.un\:​5000/​ca.crt 
 + 
 +node1# service docker restart 
 + 
 +node1# docker tag val/​webd:​latest gate.corp13.un:​5000/​webd 
 + 
 +node1# docker push gate.corp13.un:​5000/​webd 
 + 
 +node1# curl --insecure -X GET https://​gate.corp13.un:​5000/​v2/​_catalog 
 +{"​repositories":​["​webd"​]}
 </​code>​ </​code>​
  
технология_docker.1656783761.txt.gz · Last modified: 2022/07/02 20:42 by val