官方文档,才是正途-docker-compose

简介: 需要的ingress网络映射,还是host宿主机端口映射:   https://docs.docker.com/compose/compose-file/#secrets   ======================== docker service create --name web...

需要的ingress网络映射,还是host宿主机端口映射:

 

https://docs.docker.com/compose/compose-file/#secrets

 

========================

docker service create --name web \
--publish mode=host,published=80,target=80 \
nginx

==========================

ports

Expose ports.

SHORT SYNTAX

Either specify both ports (HOST:CONTAINER), or just the container port (a random host port will be chosen).

Note: When mapping ports in the HOST:CONTAINER format, you may experience erroneous results when using a container port lower than 60, because YAML will parse numbers in the format xx:yy as sexagesimal (base 60). For this reason, we recommend always explicitly specifying your port mappings as strings.

ports:
 - "3000"
 - "3000-3005"
 - "8000:8000"
 - "9090-9091:8080-8081"
 - "49100:22"
 - "127.0.0.1:8001:8001"
 - "127.0.0.1:5000-5010:5000-5010"
 - "6060:6060/udp"

LONG SYNTAX

The long form syntax allows the configuration of additional fields that can’t be expressed in the short form.

  • target: the port inside the container
  • published: the publicly exposed port
  • protocol: the port protocol (tcp or udp)
  • modehost for publishing a host port on each node, or ingress for a swarm mode port which will be load balanced.
ports:
  - target: 80
    published: 8080
    protocol: tcp
    mode: host

Note: The long syntax is new in v3.2

目录
相关文章
|
Cloud Native 测试技术 数据安全/隐私保护
云原生之使用Docker部署Teedy轻量级文档管理系统
【5月更文挑战第8天】云原生之使用Docker部署Teedy轻量级文档管理系统
450 2
|
存储 文字识别 测试技术
【Docker项目实战】使用Docker部署Docspell文档管理系统
【4月更文挑战第18天】使用Docker部署Docspell文档管理系统
596 1
|
JavaScript 测试技术 Linux
【Docker项目实战】使用Docker部署CodeX Docs文档工具
【4月更文挑战第8天】使用Docker部署CodeX Docs文档工具
566 2
|
数据安全/隐私保护 Docker 容器
Docker部署简单好用的文档管理系统MinDoc
Docker部署简单好用的文档管理系统MinDoc
868 0
|
数据可视化 Linux API
如何在Linux使用docker部署Swagger Editor并实现无公网IP远程协同编辑API文档
如何在Linux使用docker部署Swagger Editor并实现无公网IP远程协同编辑API文档
|
NoSQL MongoDB 数据库
MongoDB 解析:灵活文档数据库与 Docker Compose 部署
`MongoDB` 是一款开源、高性能的 `NoSQL` 数据库,以其无模式的文档存储格式(BSON)而著称,广泛应用于众多开源项目,包括但不限于 Yapi 等。它在大规模数据存储和实时数据处理方面表现出色,因此备受青睐。在本文中,我们将深入探讨 `MongoDB` 的特性,并详细阐述如何使用 Docker Compose 轻松部署 `MongoDB` 数据库,为你提供全方位的指导。
557 1
MongoDB 解析:灵活文档数据库与 Docker Compose 部署
|
Docker 容器
Mac Docker下安装与使用ShowDoc在线文档
Mac Docker下安装与使用ShowDoc在线文档
248 0
|
数据可视化 Linux API
使用Docker安装部署Swagger Editor并远程访问编辑API文档
使用Docker安装部署Swagger Editor并远程访问编辑API文档
297 0
|
关系型数据库 MySQL 数据安全/隐私保护
使用 Docker 部署一个文档管理系统,让宝贵文档不在丢失!
使用 Docker 部署一个文档管理系统,让宝贵文档不在丢失!
|
Docker 容器
如何使用Docker部署WPS Office服务并实现无公网IP远程处理文档表格(二)
使用Docker部署的WPS Office服务可以通过内网穿透工具Cpolar实现远程访问。首先,创建一个名为“wps office”的隧道,选择HTTP协议和3000端口,分配免费的随机域名,并指定中国地区。然后,通过Cpolar的管理界面获取HTTP公网地址,用以远程访问WPS Office。由于随机域名会变化,可以升级Cpolar套餐并保留一个二级子域名,确保长期稳定的远程访问。配置子域名后,更新隧道设置,完成固定公网地址的绑定,从而实现随时随地通过固定地址访问WPS Office。