流浪のwolf

卷帝

导航

常用的linux命令 docker常用命令

mkdir 新建目录

rmdir 删除目录

rm只能删除文件,不能删除目录

cp test.txt Documents

 

进入容器的目录

docker exec -it <container_id_or_name> /bin/bash

 

挂载容器目录到本地目录

docker run -it -v /host/path:/container/path <image_name> /bin/bash

 

从宿主机传输文件夹到 Docker 中的命令

docker cp 需要传输的文件路径 docker名字:docker中放置文件的位置

 

# 将宿主机 ik 文件夹复制到名为 address_platform_pj 的容器中的 /usr/local/elasticsearch-7.3.0/plugins 路径下面
docker cp /tmp/ik address_platform_pj:/usr/local/elasticsearch-7.3.0/plugins

posted on 2023-11-20 21:14  流浪のwolf  阅读(30)  评论(0编辑  收藏  举报