Answer the question
In order to leave comments, you need to log in
Where is the error in docker run command?
Good afternoon!
There is a docker-compose.yml file, which I run docker-compose up and everything works without problems, but for some reason I can’t run the same instructions through docker run.
docker-compose.yml
version: '3'
services:
weba:
image:docker-nginx-proxy-example_weba
expose:
- 8081
environment:
- VIRTUAL_HOST=a.localhost
sudo docker run --expose=8081 -e VIRTUAL_HOST=a.localhost docker-nginx-proxy-example_weba
Answer the question
In order to leave comments, you need to log in
expose does not forward ports to the host, so it's interesting which nginx you are knocking on :)
And the main significant difference: docker-compose also creates a default docker network in which it raises containers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question