简体   繁体   English

Docker swarm - 端口不可访问

[英]Docker swarm - Port not accessible

I am trying out some things with docker and docker swarm and currently I am running into a problem.我正在尝试使用 docker 和 docker swarm 做一些事情,目前我遇到了问题。

If I create a container with: docker run -d --name my_nginx -p 8080:80 nginx everythings went fine, I am able to access this port.如果我创建一个容器: docker run -d --name my_nginx -p 8080:80 nginx一切顺利,我可以访问这个端口。

If I try to create a service with docker swarm (container was removed before) I am not able to open that port: docker service create -d --name my_service_nginx --replicas=1 -p 8080:80 nginx如果我尝试使用 docker 群创建服务(容器之前被删除)我无法打开该端口: docker service create -d --name my_service_nginx --replicas=1 -p 8080:80 nginx

It seems that the service does not create a portmapping.该服务似乎没有创建端口映射。

CONTAINER ID   IMAGE          COMMAND                  CREATED         STATUS         PORTS     NAMES
d3417b80036c   nginx:latest   "/docker-entrypoint.…"   6 minutes ago   Up 6 minutes   80/tcp    my_service.1.1l3fwcct1m9hoallkn0g9qwpd

Do you have any idea what I am doing wrong?你知道我做错了什么吗?

Best regards Jan最好的问候简

Launching a Docker swarm on the LXC is not possible:在 LXC 上启动 Docker 群是不可能的:

Docker swarm get access from outside.network Docker swarm 从外部网络获取访问权限

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM