要让Docker容器保持运行状态,可以使用以下几种方法:
docker run -d image_name
docker start container_name
docker restart container_name
CMD ["command"]
services:
container_name:
image: image_name
restart: always
通过以上方法,可以让Docker容器在后台持续运行,并且保持运行状态。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:如何查看docker运行状态