You are not logged in.
Hi,
I'm trying to achieve this:
# docker run --rm -itp 4000:80 nginx
# curl localhost:4000
<outputs welcome page>
with docker compose.
docker-compose.yml:
services:
nginx:
image: nginx:stable
ports:
- "4001:80"
# docker stack deploy -c docker-compose.yml s1
# curl localhost:4001
<hangs>
On Ubuntu 18.04 it seems to work. But I can't see docker-18.09.0 there, so it must have been installed from some PPA.
I can access nginx via docker0 and docker_gwbridge NICs though. One guess is that Ubuntu takes extra steps for it to work with localhost. Or fixes some bug. Do you have any suggestions on how to make it work with localhost?
Thanks in advance.
Offline
Your syntax is correct but you need to specify the version at the top:
version: '3'
Then you can run it with
docker-compose up -d
in the same directory.
Offline