Skip to content

Instantly share code, notes, and snippets.

@tyler-8
Created May 4, 2018 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tyler-8/77fdd4203f4b030c444ccea072481432 to your computer and use it in GitHub Desktop.
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).
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