Created
May 4, 2018 14:13
-
-
Save tyler-8/77fdd4203f4b030c444ccea072481432 to your computer and use it in GitHub Desktop.
Docker Image for Python 3.6 and net-snmp installed (for EasySNMP usage).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.6 | |
# Annoying sources for net-snmp, which is a dependency for easysnmp | |
RUN export DEBIAN_FRONTEND=noninteractive && \ | |
export DEBIAN_RELEASE=$(awk -F'[" ]' '/VERSION=/{print $3}' /etc/os-release | tr -cd '[[:alnum:]]._-' ) && \ | |
echo "remove main from /etc/apt/sources.list" && \ | |
sed -i '/main/d' /etc/apt/sources.list && \ | |
echo "remove contrib from /etc/apt/sources.list" && \ | |
sed -i '/contrib/d' /etc/apt/sources.list && \ | |
echo "remove non-free from /etc/apt/sources.list" && \ | |
sed -i '/non-free/d' /etc/apt/sources.list && \ | |
echo "deb http://httpredir.debian.org/debian ${DEBIAN_RELEASE} main contrib non-free" >> /etc/apt/sources.list && \ | |
echo "deb http://httpredir.debian.org/debian ${DEBIAN_RELEASE}-updates main contrib non-free" >> /etc/apt/sources.list && \ | |
echo "deb http://security.debian.org ${DEBIAN_RELEASE}/updates main contrib non-free" >> /etc/apt/sources.list && \ | |
set -x &&\ | |
apt-get update && \ | |
apt-get -y install snmp snmpd snmp-mibs-downloader libsnmp-dev libmysqlclient-dev && \ | |
rm -r /var/lib/apt/lists/* && \ | |
apt-get clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment