Skip to content

Commit 701a12e

Browse files
rpi-sepStacy Patterson
andauthored
[Feature:Autograding] added spring26 dockerfile (#34)
Co-authored-by: Stacy Patterson <[email protected]>
1 parent 3dda7e4 commit 701a12e

File tree

2 files changed

+229
-1
lines changed

2 files changed

+229
-1
lines changed

dockerfiles/csci4510/metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"pushLatest": false
2+
"pushLatest": true
3+
"latestTag": "spring26"
34
}
Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
FROM ubuntu:22.04
2+
3+
ARG TARGETPLATFORM
4+
5+
RUN apt-get update \
6+
&& apt-get -y --no-install-recommends install \
7+
grep \
8+
libseccomp-dev \
9+
libseccomp2 \
10+
procps \
11+
&& rm -rf /var/lib/apt/lists/*
12+
#
13+
# Source: https://github.com/docker-library/python/blob/master/3.6/stretch/slim/Dockerfile
14+
#
15+
16+
# ensure local python is preferred over distribution python
17+
ENV PATH=/usr/local/bin:$PATH
18+
19+
# http://bugs.python.org/issue19846
20+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
21+
ENV LANG=C.UTF-8
22+
23+
# runtime dependencies
24+
RUN apt-get update && apt-get install -y --no-install-recommends \
25+
ca-certificates \
26+
netbase \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
ENV GPG_KEY=A821E680E5FA6305
30+
ENV PYTHON_VERSION=3.12.1
31+
32+
RUN set -ex \
33+
\
34+
&& savedAptMark="$(apt-mark showmanual)" \
35+
&& apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
36+
dpkg-dev \
37+
gcc \
38+
libbz2-dev \
39+
libc6-dev \
40+
libexpat1-dev \
41+
libffi-dev \
42+
libgdbm-dev \
43+
liblzma-dev \
44+
libncursesw5-dev \
45+
libreadline-dev \
46+
libsqlite3-dev \
47+
libssl-dev \
48+
make \
49+
tk-dev \
50+
wget \
51+
xz-utils \
52+
zlib1g-dev \
53+
# as of Stretch, "gpg" is no longer included by default
54+
$(command -v gpg > /dev/null || echo 'gnupg dirmngr') \
55+
\
56+
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
57+
&& wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
58+
&& export GNUPGHOME="$(mktemp -d)" \
59+
&& gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY" \
60+
&& gpg --batch --verify python.tar.xz.asc python.tar.xz \
61+
&& { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \
62+
&& rm -rf "$GNUPGHOME" python.tar.xz.asc \
63+
&& mkdir -p /usr/src/python \
64+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
65+
&& rm python.tar.xz \
66+
\
67+
&& cd /usr/src/python \
68+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
69+
&& ./configure \
70+
--build="$gnuArch" \
71+
--enable-loadable-sqlite-extensions \
72+
--enable-shared \
73+
--with-system-expat \
74+
--with-system-ffi \
75+
--without-ensurepip \
76+
&& make -j "$(nproc)" \
77+
&& make install \
78+
&& ldconfig \
79+
\
80+
&& apt-mark auto '.*' > /dev/null \
81+
&& apt-mark manual $savedAptMark \
82+
&& find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \
83+
| awk '/=>/ { print $(NF-1) }' \
84+
| sort -u \
85+
| xargs -r dpkg-query --search \
86+
| cut -d: -f1 \
87+
| sort -u \
88+
| xargs -r apt-mark manual \
89+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
90+
&& rm -rf /var/lib/apt/lists/* \
91+
\
92+
&& find /usr/local -depth \
93+
\( \
94+
\( -type d -a \( -name test -o -name tests \) \) \
95+
-o \
96+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
97+
\) -exec rm -rf '{}' + \
98+
&& rm -rf /usr/src/python \
99+
\
100+
&& python3 --version
101+
102+
# make some useful symlinks that are expected to exist
103+
RUN cd /usr/local/bin \
104+
&& ln -s idle3 idle \
105+
&& ln -s pydoc3 pydoc \
106+
&& ln -s python3 python \
107+
&& ln -s python3-config python-config
108+
109+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
110+
ENV PYTHON_PIP_VERSION=23.3.2
111+
112+
RUN set -ex; \
113+
\
114+
savedAptMark="$(apt-mark showmanual)"; \
115+
apt-get update; \
116+
apt-get install -y --no-install-recommends wget; \
117+
\
118+
wget -O get-pip.py 'https://bootstrap.pypa.io/pip/get-pip.py'; \
119+
\
120+
apt-mark auto '.*' > /dev/null; \
121+
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \
122+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
123+
rm -rf /var/lib/apt/lists/*; \
124+
\
125+
python get-pip.py \
126+
--disable-pip-version-check \
127+
--no-cache-dir \
128+
"pip==$PYTHON_PIP_VERSION" \
129+
; \
130+
pip --version; \
131+
\
132+
find /usr/local -depth \
133+
\( \
134+
\( -type d -a \( -name test -o -name tests \) \) \
135+
-o \
136+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
137+
\) -exec rm -rf '{}' +; \
138+
rm -f get-pip.py; \
139+
pip3 install aioconsole; \
140+
pip3 uninstall --yes pip setuptools
141+
142+
# Necessary as Submitty does path expansion of commands in compiling a homework,
143+
# and so resolves "python" -> "/usr/bin/python"
144+
RUN cd /usr/bin \
145+
&& ln -s /usr/local/bin/python3 python3 \
146+
&& ln -s /usr/local/bin/python3 python \
147+
&& ln -s /usr/local/bin/pip3 pip3 \
148+
&& ln -s /usr/local/bin/pip3 pip
149+
150+
151+
# Install Java 21
152+
RUN apt-get update \
153+
&& apt-get -y --no-install-recommends install openjdk-21-jdk \
154+
&& rm -rf /var/lib/apt/lists/*
155+
156+
157+
# # Go install
158+
159+
160+
ENV GO_VERSION=1.25.5
161+
162+
RUN apt-get update && apt-get install -y \
163+
ca-certificates \
164+
wget \
165+
tar \
166+
&& rm -rf /var/lib/apt/lists/*
167+
168+
RUN wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz \
169+
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \
170+
&& rm go${GO_VERSION}.linux-amd64.tar.gz
171+
172+
ENV GOPATH=/go
173+
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
174+
175+
176+
## Rust install
177+
178+
179+
ENV RUSTUP_HOME=/usr/local/rustup \
180+
CARGO_HOME=/usr/local/cargo \
181+
PATH=/usr/local/cargo/bin:$PATH \
182+
RUST_VERSION=1.92.0
183+
184+
RUN set -eux; \
185+
apt-get update; \
186+
apt-get install -y --no-install-recommends \
187+
ca-certificates \
188+
gcc \
189+
libc6-dev \
190+
wget \
191+
; \
192+
dpkgArch="$(dpkg --print-architecture)"; \
193+
case "${dpkgArch##*-}" in \
194+
amd64) rustArch='x86_64-unknown-linux-gnu' ;; \
195+
armhf) rustArch='armv7-unknown-linux-gnueabihf' ;; \
196+
arm64) rustArch='aarch64-unknown-linux-gnu' ;; \
197+
i386) rustArch='i686-unknown-linux-gnu' ;; \
198+
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
199+
esac; \
200+
url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \
201+
wget -O rustup-init "$url"; \
202+
chmod +x rustup-init; \
203+
./rustup-init -y \
204+
--no-modify-path \
205+
--profile minimal \
206+
--default-toolchain ${RUST_VERSION}; \
207+
rm rustup-init; \
208+
chmod -R a+w ${RUSTUP_HOME} ${CARGO_HOME}; \
209+
rustup --version; \
210+
cargo --version; \
211+
rustc --version; \
212+
apt-get remove -y --auto-remove \
213+
wget \
214+
; \
215+
rm -rf /var/lib/apt/lists/*
216+
217+
RUN cargo new dockerdeps \
218+
&& echo 'serde_json = "=1.0"' >> /dockerdeps/Cargo.toml \
219+
&& echo 'serde = { version = "=1.0", features = ["derive"] }' >> /dockerdeps/Cargo.toml \
220+
&& cd dockerdeps \
221+
&& cargo fetch \
222+
&& cd .. && \
223+
rm -rf dockerdeps
224+
225+
226+
227+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)