在docker中安装Ubuntu,并在该Ubuntu中安装python与pip

1)下载ubuntu镜像

docker pull ubuntu

2)查看镜像

docker images

3)运行容器

docker run -itd --name ubuntu-test ubuntu

4)进入容器

sudo docker exec -it ubuntu-test /bin/bash

5)更新源

apt-get update

6)安装python

apt-get install python

7)安装pip

apt install curl
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

8)安装其它命令

apt install iputils-ping    # ping
apt install net-tools    # ifconfig
apt-get install iproute2 iproute2-doc    # ip rule

 

你可能感兴趣的:(linux,docker,ubuntu,python)