https://github.com/myesn/docker
🐳 docker 资料整理
https://github.com/myesn/docker
docker docker-compose
Last synced: about 1 month ago
JSON representation
🐳 docker 资料整理
- Host: GitHub
- URL: https://github.com/myesn/docker
- Owner: myesn
- Created: 2021-05-10T15:12:51.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-22T01:40:52.000Z (about 5 years ago)
- Last Synced: 2025-01-12T16:36:47.243Z (over 1 year ago)
- Topics: docker, docker-compose
- Language: Dockerfile
- Homepage:
- Size: 877 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker
## 资料参考
[docker-菜鸟教程](https://www.runoob.com/docker/docker-repository.html)
## 备注
1. docker run --network test-net..,通过将多个容器连接到相同的网络,可以实现容器之间的网络连通
2. 配置dns
1. 宿主机配置,设置全部容器的 dns,配置完需要重启 docker 才能生效
`sudo nano /etc/docker/daemon.json`
```json
{
"dns" : [
"114.114.114.114",
"8.8.8.8"
]
}
```
重启 docker 服务
`sudo systemctl restart docker`
查看容器内的 dns 是否生效可以使用以下命令,它会输出容器的 dns 信息:
`sudo docker run -it --rm ubuntu cat etc/resolv.conf`
2. 手动指定容器的配置
`sudo docker run -it --rm -h host_ubuntu --dns=114.114.114.114 --dns-search=test.com ubuntu`
## 思维导图
[文件](docker.xmind)
