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.

47 lines
1.5 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. # tml-in-docker #
  2. Dockerized TML Web System
  3. ### 安裝Docker & Docker Compose
  4. 一般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. ##### 若docker host在proxy之後
  19. 請參考 https://docs.docker.com/config/daemon/systemd/#custom-docker-daemon-options
  20. ### 安裝Rancher CLI
  21. ```bash
  22. curl -LkSs https://github.com/rancher/cli/releases/download/v0.6.11/rancher-linux-amd64-v0.6.11.tar.gz | tar -xz && mv ./rancher-v0.6.11/rancher /bin/rancher && rm -rf ./rancher-v0.6.11
  23. ```
  24. ### 由Private register移除Docker Image
  25. ```bash
  26. registry='localhost:5000'
  27. name='my-image'
  28. curl -v -sSL -X DELETE "http://${registry}/v2/${name}/manifests/$(
  29. curl -sSL -I \
  30. -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
  31. "http://${registry}/v2/${name}/manifests/$(
  32. curl -sSL "http://${registry}/v2/${name}/tags/list" | jq -r '.tags[0]'
  33. )" \
  34. | awk '$1 == "Docker-Content-Digest:" { print $2 }' \
  35. | tr -d $'\r' \
  36. )"
  37. ```