You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.6 KiB

5 years ago
5 years ago
5 years ago
  1. # tml-in-docker #
  2. Dockerized TML Web System
  3. ### 安裝Docker & Docker Compose
  4. General Linux
  5. $ wget -qO- https://get.docker.com/ | sh
  6. $ sudo usermod -aG docker $(whoami)
  7. $ sudo systemctl enable docker.service
  8. $ sudo systemctl start docker.service
  9. $ sudo yum install epel-release
  10. $ sudo yum install -y python-pip
  11. $ sudo pip install docker-compose
  12. Redhat RHEL 7
  13. $ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
  14. $ yum makecache fast
  15. $ yum install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.42-1.gitad8f0f7.el7.noarch.rpm
  16. $ yum install docker-ce
  17. $ yum install docker-compose
  18. #### 注意事項
  19. - 若docker host在proxy之後
  20. 請參考 https://docs.docker.com/config/daemon/systemd/#custom-docker-daemon-options
  21. - 使用insecure registry
  22. 請參考 https://docs.docker.com/registry/insecure/
  23. ### 安裝Rancher CLI
  24. ```bash
  25. curl -LkSs https://github.com/rancher/cli/releases/download/v0.6.11/rancher-linux-amd64-v0.6.11.tar.gz | tar -xz && mv -f ./rancher-v0.6.11/rancher /bin/rancher && rm -rf ./rancher-v0.6.11
  26. ```
  27. ### 由Private register移除Docker Image (未驗證)
  28. ```bash
  29. registry='localhost:5000'
  30. name='my-image'
  31. curl -v -sSL -X DELETE "http://${registry}/v2/${name}/manifests/$(
  32. curl -sSL -I \
  33. -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
  34. "http://${registry}/v2/${name}/manifests/$(
  35. curl -sSL "http://${registry}/v2/${name}/tags/list" | jq -r '.tags[0]'
  36. )" \
  37. | awk '$1 == "Docker-Content-Digest:" { print $2 }' \
  38. | tr -d $'\r' \
  39. )"
  40. ```