From f45dd2ce043ff0e6779cca7346fcf54b386a3073 Mon Sep 17 00:00:00 2001 From: Chris Reed <55092742+cjreed121@users.noreply.github.com> Date: Fri, 29 Dec 2023 17:14:05 -0500 Subject: [PATCH] Add csci4510 (#14) * Add CSCI 4510 * Remove emacs * Update language versions * Rename dockerfile --- dockerfiles/csci4510/metadata.json | 3 + dockerfiles/csci4510/spring24/Dockerfile | 308 +++++++++++++++++++++++ 2 files changed, 311 insertions(+) create mode 100644 dockerfiles/csci4510/metadata.json create mode 100644 dockerfiles/csci4510/spring24/Dockerfile diff --git a/dockerfiles/csci4510/metadata.json b/dockerfiles/csci4510/metadata.json new file mode 100644 index 0000000..99c1ffc --- /dev/null +++ b/dockerfiles/csci4510/metadata.json @@ -0,0 +1,3 @@ +{ + "pushLatest": false +} diff --git a/dockerfiles/csci4510/spring24/Dockerfile b/dockerfiles/csci4510/spring24/Dockerfile new file mode 100644 index 0000000..e084af7 --- /dev/null +++ b/dockerfiles/csci4510/spring24/Dockerfile @@ -0,0 +1,308 @@ +FROM ubuntu:22.04 + +RUN apt-get update \ + && apt-get -y --no-install-recommends install \ + grep \ + libseccomp-dev \ + libseccomp2 \ + procps \ + && rm -rf /var/lib/apt/lists/* +# +# Source: https://github.com/docker-library/python/blob/master/3.6/stretch/slim/Dockerfile +# + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# http://bugs.python.org/issue19846 +# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. +ENV LANG C.UTF-8 + +# runtime dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + netbase \ + && rm -rf /var/lib/apt/lists/* + +ENV GPG_KEY A821E680E5FA6305 +ENV PYTHON_VERSION 3.12.1 + +RUN set -ex \ + \ + && savedAptMark="$(apt-mark showmanual)" \ + && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + dpkg-dev \ + gcc \ + libbz2-dev \ + libc6-dev \ + libexpat1-dev \ + libffi-dev \ + libgdbm-dev \ + liblzma-dev \ + libncursesw5-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + make \ + tk-dev \ + wget \ + xz-utils \ + zlib1g-dev \ +# as of Stretch, "gpg" is no longer included by default + $(command -v gpg > /dev/null || echo 'gnupg dirmngr') \ + \ + && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY" \ + && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ + && rm -rf "$GNUPGHOME" python.tar.xz.asc \ + && mkdir -p /usr/src/python \ + && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ + && rm python.tar.xz \ + \ + && cd /usr/src/python \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + && make -j "$(nproc)" \ + && make install \ + && ldconfig \ + \ + && apt-mark auto '.*' > /dev/null \ + && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && rm -rf /var/lib/apt/lists/* \ + \ + && find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + \ + && rm -rf /usr/src/python \ + \ + && python3 --version + +# make some useful symlinks that are expected to exist +RUN cd /usr/local/bin \ + && ln -s idle3 idle \ + && ln -s pydoc3 pydoc \ + && ln -s python3 python \ + && ln -s python3-config python-config + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 23.3.2 + +RUN set -ex; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends wget; \ + \ + wget -O get-pip.py 'https://bootstrap.pypa.io/pip/get-pip.py'; \ + \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/*; \ + \ + python get-pip.py \ + --disable-pip-version-check \ + --no-cache-dir \ + "pip==$PYTHON_PIP_VERSION" \ + ; \ + pip --version; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -f get-pip.py; \ + pip3 install aioconsole; \ + pip3 uninstall --yes pip setuptools + +# Necessary as Submitty does path expansion of commands in compiling a homework, +# and so resolves "python" -> "/usr/bin/python" +RUN cd /usr/bin \ + && ln -s /usr/local/bin/python3 python3 \ + && ln -s /usr/local/bin/python3 python \ + && ln -s /usr/local/bin/pip3 pip3 \ + && ln -s /usr/local/bin/pip3 pip +# +# Source: https://github.com/docker-library/openjdk/blob/master/8/jdk/slim/Dockerfile +# + +# A few reasons for installing distribution-provided OpenJDK: +# +# 1. Oracle. Licensing prevents us from redistributing the official JDK. +# +# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-8 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + # emacs \ + nano \ + vim \ + && rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && apt-get install -y \ + iproute2 \ + && rm -rf /var/lib/apt/lists/* + +# add a simple script that can auto-detect the appropriate JAVA_HOME value +# based on whether the JDK or only the JRE is installed +# RUN { \ +# echo '#!/bin/sh'; \ +# echo 'set -e'; \ +# echo; \ +# echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \ +# } > /usr/local/bin/docker-java-home \ +# && chmod +x /usr/local/bin/docker-java-home + +# # do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe +# RUN ln -svT "/usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture)" /docker-java-home +# ENV JAVA_HOME /docker-java-home + +# # Look here to update: https://packages.ubuntu.com/jammy/openjdk-11-jdk-headless +# ENV JAVA_VERSION 11.0.21 +# ENV JAVA_UBUNTU_VERSION 11.0.21+9-0ubuntu1~22.04 + +# RUN set -ex; \ +# \ +# # deal with slim variants not having man page directories (which causes "update-alternatives" to fail) +# if [ ! -d /usr/share/man/man1 ]; then \ +# mkdir -p /usr/share/man/man1; \ +# fi; \ +# \ +# # ca-certificates-java does not work on src:openjdk-11 with no-install-recommends: (https://bugs.debian.org/914860, https://bugs.debian.org/775775) +# # /var/lib/dpkg/info/ca-certificates-java.postinst: line 56: java: command not found +# ln -svT /docker-java-home/bin/java /usr/local/bin/java; \ +# \ +# apt-get update; \ +# apt-get install -y --no-install-recommends \ +# openjdk-11-jdk-headless="$JAVA_UBUNTU_VERSION" \ +# ; \ +# rm -rf /var/lib/apt/lists/*; \ +# \ +# rm -v /usr/local/bin/java; \ +# \ +# # ca-certificates-java does not work on src:openjdk-11: (https://bugs.debian.org/914424, https://bugs.debian.org/894979, https://salsa.debian.org/java-team/ca-certificates-java/commit/813b8c4973e6c4bb273d5d02f8d4e0aa0b226c50#d4b95d176f05e34cd0b718357c532dc5a6d66cd7_54_56) +# keytool -importkeystore -srckeystore /etc/ssl/certs/java/cacerts -destkeystore /etc/ssl/certs/java/cacerts.jks -deststoretype JKS -srcstorepass changeit -deststorepass changeit -noprompt; \ +# mv /etc/ssl/certs/java/cacerts.jks /etc/ssl/certs/java/cacerts; \ +# /var/lib/dpkg/info/ca-certificates-java.postinst configure; \ +# \ +# # verify that "docker-java-home" returns what we expect +# [ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \ +# \ +# # update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java +# update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \ +# # ... and verify that it actually worked for one of the alternatives we care about +# update-alternatives --query java | grep -q 'Status: manual' + +# # see CA_CERTIFICATES_JAVA_VERSION notes above +# RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure + +# # Go install + +ENV GOLANG_VERSION 1.21.5 + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends wget; \ +# this "case" statement is generated via "update.sh" + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + amd64) goRelArch='linux-amd64'; goRelSha256='e2bc0b3e4b64111ec117295c088bde5f00eeed1567999ff77bc859d7df70078e' ;; \ + armhf) goRelArch='linux-armv6l'; goRelSha256='837f4bf4e22fcdf920ffeaa4abf3d02d1314e03725431065f4d44c46a01b42fe' ;; \ + arm64) goRelArch='linux-arm64'; goRelSha256='841cced7ecda9b2014f139f5bab5ae31785f35399f236b8b3e75dff2a2978d96' ;; \ + i386) goRelArch='linux-386'; goRelSha256='8f4dba9cf5c61757bbd7e9ebdb93b6a30a1b03f4a636a1ba0cc2f27b907ab8e1' ;; \ + ppc64el) goRelArch='linux-ppc64le'; goRelSha256='907b8c6ec4be9b184952e5d3493be66b1746442394a8bc78556c56834cd7c38b' ;; \ + s390x) goRelArch='linux-s390x'; goRelSha256='9c4a81b72ebe44368813cd03684e1080a818bf915d84163abae2ed325a1b2dc0' ;; \ + *) goRelArch='src'; goRelSha256='285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19'; \ + echo >&2; echo >&2 "warning: current architecture ($dpkgArch) does not have a corresponding Go binary release; will be building from source"; echo >&2 ;; \ + esac; \ + \ + url="https://golang.org/dl/go${GOLANG_VERSION}.${goRelArch}.tar.gz"; \ + wget -O go.tgz "$url"; \ + echo "${goRelSha256} *go.tgz" | sha256sum -c -; \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ + if [ "$goRelArch" = 'src' ]; then \ + echo >&2; \ + echo >&2 'error: UNIMPLEMENTED'; \ + echo >&2 'TODO install golang-any from jessie-backports for GOROOT_BOOTSTRAP (and uninstall after build)'; \ + echo >&2; \ + exit 1; \ + fi; \ + \ + export PATH="/usr/local/go/bin:$PATH"; \ + go version + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH + + +# ENV RUSTUP_HOME=/usr/local/rustup \ +# CARGO_HOME=/usr/local/cargo \ +# PATH=/usr/local/cargo/bin:$PATH \ +# RUST_VERSION=1.46.0 + +# RUN set -eux; \ +# apt-get update; \ +# apt-get install -y --no-install-recommends \ +# ca-certificates \ +# gcc \ +# libc6-dev \ +# wget \ +# ; \ +# dpkgArch="$(dpkg --print-architecture)"; \ +# case "${dpkgArch##*-}" in \ +# amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='ad1f8b5199b3b9e231472ed7aa08d2e5d1d539198a15c5b1e53c746aad81d27b' ;; \ +# armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='6c6c3789dabf12171c7f500e06d21d8004b5318a5083df8b0b02c0e5ef1d017b' ;; \ +# arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='26942c80234bac34b3c1352abbd9187d3e23b43dae3cf56a9f9c1ea8ee53076d' ;; \ +# i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='27ae12bc294a34e566579deba3e066245d09b8871dc021ef45fc715dced05297' ;; \ +# *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ +# esac; \ +# url="https://static.rust-lang.org/rustup/archive/1.21.1/${rustArch}/rustup-init"; \ +# wget "$url"; \ +# echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ +# chmod +x rustup-init; \ +# ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION; \ +# rm rustup-init; \ +# chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ +# rustup --version; \ +# cargo --version; \ +# rustc --version; \ +# apt-get remove -y --auto-remove \ +# wget \ +# ; \ +# rm -rf /var/lib/apt/lists/*; +CMD ["/bin/bash"]