修改docker容器内的sysctl参数
我正在运行一个3节点的swarm群集,并尝试使用 docker堆栈部署 下面是我的撰写文件修改docker容器内的sysctl参数,docker,docker-compose,docker-swarm,swarm,sysctl,Docker,Docker Compose,Docker Swarm,Swarm,Sysctl,我正在运行一个3节点的swarm群集,并尝试使用 docker堆栈部署 下面是我的撰写文件 services: nginx: image: nginx:latest networks: - til-prod-network volumes: - type: bind source: /tmp/nginx/nginx.conf target: /etc/nginx/nginx.conf ports: - 83:
services:
nginx:
image: nginx:latest
networks:
- til-prod-network
volumes:
- type: bind
source: /tmp/nginx/nginx.conf
target: /etc/nginx/nginx.conf
ports:
- 83:80
depends_on:
- BLUE
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
placement:
constraints:
- node.role == manager
resources:
reservations:
memory: 4096M
limits:
memory: 4096M
BLUE:
image: dtr.xxx.xxx/cmdb:v1.26
sysctls:
net.core.somaxconn: 4096
networks:
- til-prod-network
deploy:
replicas: 2
update_config:
parallelism: 1
delay: 10s
placement:
constraints:
- node.role == worker
resources:
reservations:
memory: 2048M
limits:
memory: 2048M
networks:
til-prod-network:
external: true
但当我通过docker stack deploy部署它时,它会给我“不支持的选项sysctls”的错误
Docker医生也这么说
在swarm模式下运行时,我应该实现什么解决方案来修改容器内的sysctl
目前,没有针对docker中docker swarm集群的正确解决方案