以Ubuntu16:04作为基础版本
docker pull ubuntu:16.04 启动一个容器 docker run -d -i -t --name flow_mete ubuntu:16.04 bash 进入容器 docker exec -it flow_mete bash cd ~安装基本软件
apt-get update && apt-get upgrade -y && apt-get install -y curl wget vim build-essential ca-certificates gcc git libpq-dev make python-pip python2.7 python2.7-dev ssh libmysqlclient-dev && apt-get autoremove && apt-get clean安装最新pip
python -m pip uninstall pip setuptools wget https://bootstrap.pypa.io/get-pip.py python get-pip.py ln -s /usr/local/bin/pip /usr/bin/pip && pip list 安装net-snmp wget https://sourceforge.net/projects/net-snmp/files/net-snmp/5.7.3/net-snmp-5.7.3.tar.gz tar zxvf net-snmp-5.7.3.tar.gz apt-get install libperl-dev cd net-snmp-5.7.3 ./configure --with-python-modules --enable-developer --libdir=/usr/lib64 --enable-shared --with-default-snmp-version="2" --with-sys-contact="@@no.where" --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" make make install cd .. echo export LD_LIBRARY_PATH=/usr/local/lib >> .bashrc export LD_LIBRARY_PATH=/usr/local/lib snmpget --version安装python扩展;
cd net-snmp-5.7.3/python python setup.py build python setup.py test python setup.py install安装rrdtool:
apt-get install -y rrdtool python-rrdtool设置时区:
apt-get install tzdata dpkg-reconfigure tzdata 选择6. Asia -》 69. Shanghai 查看date -R docker commit -m "flow-mete env init" flow_mete direpos.capitalonline.net/flow-mete:20180617 docker push direpos.capitalonline.net/flow-mete:20180617