with docker-compose I know how to do that:
version: '3.0'
services:
redis:
image: redis
volumes:
- redis_data:/data
volumes:
redis_data:
How to run the same without dockerfile/compose file?
Thank you
with docker-compose I know how to do that:
version: '3.0'
services:
redis:
image: redis
volumes:
- redis_data:/data
volumes:
redis_data:
How to run the same without dockerfile/compose file?
Thank you
3
Answers
With plain Docker, you use the
-v
option:Here you can find more on this.
Try this one:
Since you are already using
docker-compose
, useexternal
option for volume:From docs: