Reputation: 1408
I have the following image that works great via the command
docker run my-hello-world echo hello!
Obviously a contrived example however how can I convert this into a small docker-compose.yml file? docker-compose doesn't appear to have a run command. Can it not run containers???
Upvotes: 2
Views: 1080
Reputation: 562
You can just paste your run command to this website and let it do the work for you!
Upvotes: 0
Reputation: 2687
You can run container's command with Docker Compose and provision containers. But you don't use docker run
instead you use docker-compose up
and down
to up and down containers. In this case, try create a docker-compose.yml
file with the contents:
version: '2'
services:
app1:
image: my-hello-world
command: "echo hello!"
Upvotes: 2