docker -安装Python 脚本
Posted 你所能做的,就是不断的学习
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker -安装Python 脚本相关的知识,希望对你有一定的参考价值。
#! /bin/bash
cd /tmp
echo "current direction is $(pwd)"
yum -y install wget
wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz
tar -zxvf Python-3.6.6.tgz
##python dependency
yum install -y gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
yum -y install gcc automake autoconf libtool make
yum -y install gcc gcc-c++
echo "current direction is $(pwd)"
if [ -d /tmp/Python-3.6.6 ];then
echo "tar success .start make";
cd Python-3.6.6;
./configure --prefix=/tmp/python36;
make;
make install;
cd /tmp/python36
echo "python make end ,start env"
dir=$(pwd)
echo ‘PATH=$PATH:‘$dir/bin >> /etc/profile
source /etc/profile
echo "current PATH =$PATH"
mv /usr/bin/python /usr/bin/python_bak
ln -s $dir/bin/python3 /usr/bin/python
fi
以上是关于docker -安装Python 脚本的主要内容,如果未能解决你的问题,请参考以下文章
shell脚本部署docker和docker-compose