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>
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.
docker run --name <name>:0.2.34
This will run your built image
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With