mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
Update Grafana to v13, add version notes
This commit is contained in:
@@ -53,7 +53,7 @@ docker network inspect my-overlay-net
|
||||
docker service create --name web \
|
||||
--network my-overlay-net \
|
||||
--replicas 3 \
|
||||
nginx:latest
|
||||
nginx # 确保与环境兼容的 Nginx 版本
|
||||
|
||||
# 单机环境下也可以让普通容器加入 attachable overlay 网络
|
||||
docker run -d --name container1 --network my-overlay-net busybox sleep 1d
|
||||
@@ -111,14 +111,14 @@ docker run -d \
|
||||
--dns 8.8.8.8 \
|
||||
--dns 1.1.1.1 \
|
||||
--dns-search example.com \
|
||||
nginx:latest
|
||||
nginx # 确保与环境兼容的 Nginx 版本
|
||||
|
||||
# DNS 选项
|
||||
docker run -d \
|
||||
--dns-option ndots:2 \
|
||||
--dns-option timeout:1 \
|
||||
--dns-option attempts:3 \
|
||||
nginx:latest
|
||||
nginx # 确保与环境兼容的 Nginx 版本
|
||||
|
||||
# 查看容器 DNS 配置
|
||||
docker exec <container_id> cat /etc/resolv.conf
|
||||
@@ -171,8 +171,8 @@ networks:
|
||||
docker network create mynet
|
||||
|
||||
# 运行服务
|
||||
docker run -d --name web --network mynet nginx:latest
|
||||
docker run -d --name db --network mynet postgres:latest
|
||||
docker run -d --name web --network mynet nginx # 确保与环境兼容的 Nginx 版本
|
||||
docker run -d --name db --network mynet postgres # 确保与环境兼容的 PostgreSQL 版本
|
||||
|
||||
# 在其他容器中通过服务名访问
|
||||
docker run -it --network mynet busybox sh
|
||||
|
||||
Reference in New Issue
Block a user