docker常规操作——启动、停止、重启容器实例

本文介绍了如何使用Docker命令启动、停止及重启容器实例。包括使用docker start、docker stop及docker restart的具体方法,并解释了这些命令的不同选项及其作用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本系列目录请看这里

https://blog.youkuaiyun.com/michel4liu/article/details/80819510


前几篇我们已经掌握了docker容器实例的运行,接下来我们就来了解一下关于容器实例的 启动、停止、重启。

一、启动一个已经停止的容器实例

docker start 容器ID或容器名
1. 先查看已经暂停的容器实例信息
2. 通过docker start 59ec 启动容器
3. 通过docker ps 查看当前启动的容器
具体操作如下图
这里写图片描述
docker start 还有两个参数
-i:以 交互模式启动 交互模式不懂点我
-t:以 附加进程方式启动 附加进程不懂的点我

二、停止一个正在运行的容器
1、docker stop 此方式常常被翻译为优雅的停止容器

docker stop 容器ID或容器名
参数 -t:关闭容器的限时,如果超时未能关闭则用kill强制关闭,默认值10s,这个时间用于容器的自己保存状态
docker stop -t=60 容器ID或容器名

2、docker kill

docker kill 容器ID或容器名 :直接关闭容器

由此可见stop和kill的主要区别:stop给与一定的关闭时间交由容器自己保存状态,kill直接关闭容器

想更进一步了解处理机制的可以看下面这篇文章,比较详细但是需要其他方面的
https://www.jb51.net/article/96617.htm

三、重启一个容器

docker restart 容器ID或容器名 :不管容器是否启动,直接重启容器
1. 首先 docker ps 查看正在运行的容器信息,显示2分钟前启动运行
2. docker restart 59ec 重启容器
3. 再次 docker ps 查看容器信息 显示 2秒前启动运行
这里写图片描述
docker restart 参数
-t:关闭容器的限时,如果超时未能关闭则用kill强制关闭,默认值10s,这个时间用于容器的自己保存状态
这里写图片描述


本系列目录请看这里

https://blog.youkuaiyun.com/michel4liu/article/details/80819510

### NVIDIA B100 GPU Specifications and Information NVIDIA B100 GPU represents a significant advancement in the field of high-performance computing, particularly suited for deep learning and scientific calculations. This device adopts NVIDIA's latest GPU architecture, integrating an extensive number of Tensor Cores and CUDA Cores to provide robust computational power for various tasks such as training large-scale neural networks or conducting complex simulations[^3]. #### Architecture and Performance The integration of numerous Tensor Cores alongside traditional CUDA cores ensures that B100 can handle both matrix operations critical for AI applications efficiently while maintaining versatility across other types of workloads. Moreover, support for multiple precision formats including FP32 (single), FP16 (half), TF32 further enhances its adaptability by allowing users to choose between speed and accuracy based on their specific requirements. #### Memory Configuration In terms of memory configuration, although not explicitly detailed within provided references, it is implied from context clues about similar GPUs like A100 which typically feature substantial amounts of fast-access RAM designed specifically around optimizing data throughput during intensive processing sessions involving massive datasets common today’s cutting-edge research projects[^1]. ```python # Example Python code demonstrating how one might interact with TensorFlow using mixed precisions supported by B100. import tensorflow as tf with tf.device('/GPU:0'): # Use float16 policy for better performance when possible policy = tf.keras.mixed_precision.Policy('mixed_float16') model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'], dtype=policy) ```
评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值