1+ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/python-3/.devcontainer/base.Dockerfile
2+
3+ # [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
4+ ARG VARIANT="3.10-bullseye"
5+ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
6+
7+ EXPOSE 8000
8+
9+ ENV DEBIAN_FRONTEND=noninteractive
10+
11+ RUN apt-get update
12+ RUN apt-get -qy upgrade
13+
14+ # Install the packages we need
15+ RUN apt-get install -qy \
16+ build-essential \
17+ bzip2 \
18+ ca-certificates \
19+ colordiff \
20+ gawk \
21+ gcc \
22+ python3-ipython \
23+ jq \
24+ less \
25+ libbz2-dev \
26+ libdb5.3-dev \
27+ libexpat1-dev \
28+ libffi-dev \
29+ libgdbm-dev \
30+ libjpeg62-turbo-dev \
31+ liblzma-dev \
32+ libmagic1 \
33+ libmariadb-dev-compat \
34+ libmariadb-dev \
35+ libncurses5-dev \
36+ libncursesw5-dev \
37+ libreadline-dev \
38+ libsqlite3-dev \
39+ libssl-dev \
40+ libsvn1 \
41+ libxml2-dev \
42+ libxslt-dev \
43+ libyang1 \
44+ libz-dev \
45+ libffi-dev \
46+ locales \
47+ make \
48+ man \
49+ mariadb-client \
50+ netcat \
51+ openssh-client \
52+ patch \
53+ procps \
54+ pv \
55+ rsync \
56+ rsyslog \
57+ subversion \
58+ sudo \
59+ uuid-dev \
60+ vim \
61+ wget \
62+ xz-utils\
63+ zile \
64+ zlib1g-dev
65+
66+ # Install libyang
67+ # RUN wget -nv http://download.opensuse.org/repositories/home:liberouter/Debian_9.0/Release.key && \
68+ # apt-key add - < Release.key && \
69+ # rm Release.key && \
70+ # echo "deb http://download.opensuse.org/repositories/home:/liberouter/Debian_9.0/ /" >> /etc/apt/sources.list.d/libyang.list && \
71+ # apt-get update && \
72+ # apt-get install -qy libyang1
73+
74+ # Install chromedriver
75+ RUN apt-get update && \
76+ apt-get install -y gnupg wget curl unzip --no-install-recommends && \
77+ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
78+ echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list && \
79+ apt-get update -y && \
80+ apt-get install -y google-chrome-stable && \
81+ CHROMEVER=$(google-chrome --product-version | grep -o "[^\. ]*\. [^\. ]*\. [^\. ]*" ) && \
82+ DRIVERVER=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEVER" ) && \
83+ wget -q --continue -P /chromedriver "http://chromedriver.storage.googleapis.com/$DRIVERVER/chromedriver_linux64.zip" && \
84+ unzip /chromedriver/chromedriver* -d /chromedriver && \
85+ ln -s /chromedriver/chromedriver /usr/local/bin/chromedriver && \
86+ ln -s /chromedriver/chromedriver /usr/bin/chromedriver
87+
88+ # Get rid of installation files we don't need in the image, to reduce size
89+ RUN apt-get clean && rm -rf /var/lib/apt/lists/*
90+
91+ # Enable some common locales
92+ RUN sed -i -e 's/^. en_US/en_US/' -e 's/^. en_GB/en_GB/' -e 's/^. en_IE/en_IE/' /etc/locale.gen && \
93+ locale-gen
94+
95+ # Remove an rsyslog module that we don't need, which also requires extra permissions
96+ RUN sed -i -e '/load="imklog"/d' /etc/rsyslog.conf
97+
98+ # Set up root password
99+ RUN echo "root:root" | chpasswd
100+
101+ # idnits and dependencies
102+ ADD https://tools.ietf.org/tools/idnits/idnits /usr/local/bin/
103+ RUN chmod +rx /usr/local/bin/idnits
104+
105+ # Directory for Mac certs
106+ RUN mkdir /etc/certificates
107+
108+ # Setup workspace
109+ ENV HOSTNAME="datatracker"
110+
111+ ENV DDIR="/usr/local/share/datatracker"
112+ RUN mkdir -p $DDIR
113+ WORKDIR $DDIR
114+
115+ COPY requirements.txt /tmp/pip-tmp/
116+ RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
117+ && rm -rf /tmp/pip-tmp
118+
119+ COPY .devcontainer/init.sh /docker-init.sh
120+ RUN chmod +x /docker-init.sh
121+ ENTRYPOINT ["/docker-init.sh" ]
122+ CMD ["sleep" , "infinity" ]
123+
124+ # [Optional] Uncomment this section to install additional OS packages.
125+ # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
126+ # && apt-get -y install --no-install-recommends <your-package-list-here>
127+
128+ # [Optional] Uncomment this line to install global node packages.
129+ # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
0 commit comments