JiaHe

相遇即是缘

Docker

https://docs.docker.com/engine/install/

配置hosts,解决github无法访问问题
# Generated by hosts-generator start 
185.199.109.154 github.githubassets.com
140.82.114.22 central.github.com
185.199.108.133 desktop.githubusercontent.com
185.199.109.153 assets-cdn.github.com
185.199.108.133 camo.githubusercontent.com
185.199.108.133 github.map.fastly.net
151.101.41.194 github.global.ssl.fastly.net
192.30.255.113 gist.github.com
185.199.108.153 github.io
192.30.255.113 github.com
192.30.255.116 api.github.com
185.199.111.133 raw.githubusercontent.com
185.199.108.133 user-images.githubusercontent.com
185.199.109.133 favicons.githubusercontent.com
185.199.108.133 avatars5.githubusercontent.com
185.199.108.133 avatars4.githubusercontent.com
185.199.108.133 avatars3.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
185.199.109.133 avatars1.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.110.133 avatars.githubusercontent.com
192.30.255.120 codeload.github.com
52.216.240.156 github-cloud.s3.amazonaws.com
54.231.171.57 github-com.s3.amazonaws.com
52.217.128.249 github-production-release-asset-2e65be.s3.amazonaws.com
52.216.86.195 github-production-user-asset-6210df.s3.amazonaws.com
52.216.61.193 github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153 githubstatus.com
140.82.114.18 github.community
185.199.108.133 media.githubusercontent.com

# Last update: 1/11/2023, 2:17:12 PM

# Please star: https://github.com/fliu2476/gh-hosts.git

# Generated by hosts-generator end

````
</details>

<details>
<summary>一键安装</summary>
```shell
mkdir -p /etc/docker
echo '''
{
"registry-mirrors": [
"https://mirror.ccs.tencentyun.com",
"http://registry.docker-cn.com",
"https://docker.mirrors.ustc.edu.cn",
"http://hub-mirror.c.163.com"
]
}''' > /etc/docker/daemon.json

sudo curl -sSL https://get.daocloud.io/docker | sh

sudo curl -L "https://github.com/docker/compose/releases/download/1.28.6/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

sudo systemctl start docker
````

</details>

安装Docker

```shell
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
# 下面这条无法访问了
curl -sSL https://get.daocloud.io/docker | sh

配置Docker的国内源,将以下内容保存到 /etc/docker/daemon.json

/etc/docker/daemon.json
{
"registry-mirrors": [
"https://mirror.ccs.tencentyun.com",
"http://registry.docker-cn.com",
"https://docker.mirrors.ustc.edu.cn",
"http://hub-mirror.c.163.com"
]
}

启动Docker

systemctl start docker

安装Docker-Compose

Docker与Docker-Compose的版本对应关系参考如下:

sudo curl -L "https://github.com/docker/compose/releases/download/1.28.6/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose