Files
lth-coder-template/build/Dockerfile
T

30 lines
1.0 KiB
Docker

FROM ubuntu:latest AS base
# 1. Combine updates and system-level tools to save space
RUN apt-get update && apt-get install -y --no-install-recommends \
curl jq git sudo vim wget unzip locales \
build-essential libgmp-dev libffi-dev libnuma-dev zlib1g-dev libtinfo-dev \
python3 python3-venv python3-tk python-is-python3 \
default-jdk \
&& rm -rf /var/lib/apt/lists/*
# 2. Setup Locales
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG=en_US.utf8
# 3. Copy Gradle (This is fine as is)
COPY --from=gradle:latest /opt/gradle /opt/gradle
ENV GRADLE_HOME=/opt/gradle
ENV PATH="${GRADLE_HOME}/bin:${PATH}"
# 4. Define the user
ARG USER=lth-student
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER}
USER ${USER}
WORKDIR /home/${USER}
# Add local bin paths to PATH now so they work once installed in Home
ENV PATH="/home/${USER}/.ghcup/bin:/home/${USER}/.local/bin:${PATH}"