docker杂记

228 阅读1分钟

ubuntu安装docker

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

docker换阿里云源

 vi /etc/docker/daemon.json
 写入:
 {
  "registry-mirrors": ["https://4zgajege.mirror.aliyuncs.com"]
 }
 sudo systemctl daemon-reload
 sudo systemctl restart docker

docker安装Ubuntu

docker pull ubuntu
docker run -t -i ubuntu /bin/bash  //不加-i的话会运行一下就退出容器
// -i: 交互式操作。
// -t: 终端。
// ubuntu:15.10: 这是指用 ubuntu 15.10 版本镜像为基础来启动容器。
// /bin/bash:放在镜像名后的是命令,这里我们希望有个交互式 Shell,因此用的是 /bin/bash。
apt-get update
apt-get install sudo

docker-ubuntu安装anaconda

sudo apt install curl
curl -O https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh