diff --git a/build/Dockerfile b/build/Dockerfile index 3a8106c..c347d05 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,14 +1,12 @@ -FROM python:slim-bookworm AS base +FROM ubuntu:latest AS base # Copy Java from openjdk:26-oracle COPY --from=openjdk:21 /usr/java/openjdk-21 /usr/java/openjdk-21 ENV JAVA_HOME=/usr/java/openjdk-21 -ENV PATH="${JAVA_HOME}/bin:${PATH}" # Copy Gradle from gradle:latest COPY --from=gradle:latest /opt/gradle /opt/gradle ENV GRADLE_HOME=/opt/gradle -ENV PATH="${GRADLE_HOME}/bin:${PATH}" # Update and install dependencies RUN apt-get -y update @@ -25,15 +23,24 @@ RUN apt-get install -y \ RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG=en_US.utf8 -FROM base AS requirements +FROM base AS python-init + +# Install Python +RUN apt-get install -y \ + python3 \ + python3-pip \ + python3-venv \ + python3-tk \ + python-is-python3 # Install Python Packages -RUN pip3 install \ +RUN pip install \ requests \ rich \ - ipykernel + ipykernel \ + --break-system-packages -FROM requirements AS scala +FROM python-init AS scala # Install Scala ARG SCALA_VERSION="3.7.3" @@ -45,14 +52,6 @@ RUN curl -fsL --show-error ${URL} | tar xfz - -C /usr/share && \ chmod -R 755 /usr/share/scala && \ ln -s /usr/share/scala/bin/* /usr/local/bin -# Install Gradle -# ARG GRADLE_VERSION="9.1.0" -# RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp -# RUN unzip -d /opt/gradle /tmp/gradle-${GRADLE_VERSION}-bin.zip -# RUN ln -s /opt/gradle/gradle-${GRADLE_VERSION} /opt/gradle/latest -# ENV GRADLE_HOME=/opt/gradle/latest -# ENV PATH=$PATH:$GRADLE_HOME/bin - FROM scala AS lth # Clears apt lists @@ -66,4 +65,7 @@ RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \ # Sets user and work directory USER ${USER} -WORKDIR /home/${USER} \ No newline at end of file +WORKDIR /home/${USER} + +ENV PATH="${JAVA_HOME}/bin:${PATH}" +ENV PATH="${GRADLE_HOME}/bin:${PATH}" \ No newline at end of file diff --git a/main.tf b/main.tf index 381d617..28ff406 100644 --- a/main.tf +++ b/main.tf @@ -158,7 +158,6 @@ resource "docker_container" "workspace" { image = docker_image.main.name cpu_set = "0-11" memory = 4096 - privileged = true # Uses lower() to avoid Docker restriction on container names. name = "coder-${data.coder_workspace_owner.me.name}-${lower(data.coder_workspace.me.name)}" # Hostname makes the shell more user friendly: coder@my-workspace:~$