Reputation: 1057
I have built an image using my dockerfile with the following command:
docker build –t <name>:0.2.34 .
and then I have tried to use my docker-compose.yml:
strat:
container_name: <name>
image: <name>:0.2.34
restart: always
command: bash -lc 'blah'
to bring up my container:
docker-compose up -d <name>
Which gives me the following 'error':
No such service: <name>
Upvotes: 27
Views: 76812
Reputation: 10664
You should run: docker-compose up -d strat
From the documentation:
Usage: up [options] [SERVICE...]
You need to specify your service name, not your image name.
Note: You can simply run docker-compose up -d
to start all the services that are in your docker-compose file.
Upvotes: 33