# 查看容器ID
docker ps -a
# 本地文件拷本到容器
docker cp {local_path} {CONTAINER ID}:{path}
# 容器拷本到本地
docker cp {CONTAINER ID}:{path} {local_path}
# eg
docker cp /Users/helloworld/Downloads/R-3.5.0 0a1d7db7946:/tmp/
这是因为我们[docker](https://so.csdn.net/so/search?q=docker&spm=1001.2101.3001.7020) client使用的是https,而我们搭建的Harbor私库用的是http的
编辑 /etc/docker/daemon.json
添加私服地址
{"insecure-registries":["仓库ip:port"]}
# 重启docker
sudo systemctl daemon-reload
sudo systemctl restart docker
3.docke load 后找不到镜像
# docker load 后弹出的sha256的前几位就是镜像ID
# 模糊查询即可
docker images --format '{{.ID}}' | grep '^709f2bc'
FROM ubuntu:14.04
MAINTAINER "name" <email>
RUN apt-get update
RUN apt-get install -y nginx
EXPOSE 80
CMD ["nginx"]
docker build -t nginx.
docker images
docker rmi <image_name>
docker push <image_name>
docker pull <image_name>
docker tag <image_name> <new_image_name>
docker save -o <image_name>.tar <image_name>
docker load -i <image_name>.tar
docker run -d -p 80:80 nginx
docker stop <container_id>
docker rm <container_id>
docker logs <container_id>
docker exec -it <container_id> /bin/bash
docker exec -it <container_id> sh
docker export <container_id> > <container_name>.tar
docker import <container_name>.tar
docker network ls
docker network create <network_name>
docker network rm <network_name>
docker network connect <network_name> <container_id>
docker volume ls
docker volume create <volume_name>
docker volume rm <volume_name>
docker run -d -v <host_path>:<container_path> <image
docker run -d -v /home/data/mysql:/var/lib/mysql mysql
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
docker volume rm $(docker volume ls -q)
docker network rm $(docker network ls -q)
docker system prune -a