Reputation: 27
I wanted to convert docker run command to docker compose. Can you plz give some clue.
docker run -dit -h nginx --name=nginx --net=internal -p 8085:80 --restart=always -v /default.conf:/etc/nginx/conf.d/default.conf nginx:latest
Upvotes: 1
Views: 514
Reputation: 20306
Use docker run --help
to understand what each of the used options does. Then proceed to the Compose file reference and find there how it is configured with YAML
.
Note that some command line arguments have no equivalents in compose. That is either because they are not yet implemented or because they are also used as command line options. An example of the latter is -d
, which run the container in detached mode. Its equivalent for docker-compose
is also -d
(e.g docker-compose up -d
).
Upvotes: 1