future-state-33133
02/10/2023, 8:35 AM$ docker service create --name my-web --publish published=8080,target=80 nginx
u5gnfzi3y4tk2g55oetz6xr09
overall progress: 1 out of 1 tasks
1/1: running [==================================================>]
verify: Service converged
$ docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
ccb38gngph5c my-web replicated 1/1 nginx:latest *:8080->80/tcp
$ docker service ps my-web
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
wihld1wo7mhu my-web.1 nginx:latest lima-rancher-desktop Running Running 15 seconds ago
$ curl -v <http://localhost:8080>
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.86.0
> Accept: */*
>
^C
I have to exit the connection, because there is no answer returned.
If I try curl from the lima container it works correctly
lima-rancher-desktop:/Users/denis$ curl -v <http://localhost:8080>
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.83.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.23.3
< Date: Thu, 09 Feb 2023 14:59:12 GMT
< Content-Type: text/html
< Content-Length: 615
< Last-Modified: Tue, 13 Dec 2022 15:53:53 GMT
< Connection: keep-alive
< ETag: "6398a011-267"
< Accept-Ranges: bytes
.....
If I deploy the same nginx container with docker compose, it responds as it should.
I found this url might be related?
https://github.com/moby/moby/issues/41775--network-address assign reachable IP address to the VM
Does RacherDesktop also has something like this?calm-sugar-3169
02/10/2023, 11:55 PMfuture-state-33133
02/13/2023, 8:23 AM