docker内部安装ubuntu18.04_core

1.拉取原生镜像包
docker pull ubuntu:devel
2.按照文件映射需求创建容器
sudo docker run -it -v /home/hsc/workspace/containers_space/nestaidataset/:/home/workspace/ --name aidataset ubuntu:devel bash
3.进入docker容器,以下场景在官方source.list下更新并安装各种组件包
4.在官方下载python.tgz
https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
5.更新相关组件下载位置
apt-get update && apt-get upgrade
6.安装系统常见组件包
apt-get install net-tools inetutils-ping openssh-server samba samba-common git vim curl
7.apt-get install gcc
8.安装编译程序必须软件包
apt-get install build-essential
9.安装zlib1g-dev
apt-get install zlib1g-dev
10.开始安装python
tar -zxvf Python-3.7.5.tgz
mv Python-3.7.5 /usr/local/python-3.7.5
cd /usr/local/python-3.7.5/
查看gcc和g++版本
gcc --version
g++ --version
./configure --with-ssl
make
make install
查看python版本和pip版本,默认已经同时安装pip
pip3 -V
链接Python
ln -s /usr/bin/python3 /usr/bin/python
链接pip
ln -s /usr/bin/pip3 /usr/bin/pip
pip更换tsinghua
mkdir ~/.pip
vim ~/.pip/pip.conf粘贴如下即可:
'''
[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
trusted-host = pypi.tuna.tsinghua.edu.cn
'''

你可能感兴趣的:(docker内部安装ubuntu18.04_core)