Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node with JDK17 #9

Draft
wants to merge 6 commits into
base: trunk
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# syntax=docker/dockerfile:1
FROM debian:stable
FROM gradle:8.2.1-jdk17

RUN rm /bin/sh && ln -s /bin/bash /bin/sh

# Increase the file watcher limit for node. This should not be necessary for CI builds since watchers should be disabled, but it can be useful when running this image in a local environment.
RUN echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a specific number 😅


# Install system commands, Android SDK, and Ruby
RUN apt-get update \
&& apt-get install -y coreutils git wget locales android-sdk android-sdk-build-tools \
&& apt-get install -y coreutils git wget locales \
&& apt-get install -y curl git php-cli php-mbstring \
&& apt-get -y autoclean

# Set up the default locale
Expand All @@ -15,9 +19,9 @@ ENV ANDROID_HOME=/usr/lib/android-sdk
ENV GRADLE_OPTS="-Xmx6G -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false"

# Download the SDK Manager
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip \
&& unzip commandlinetools-linux-6858069_latest.zip && rm commandlinetools-linux-6858069_latest.zip \
&& mkdir /usr/lib/android-sdk/cmdline-tools \
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip \
&& unzip commandlinetools-linux-11076708_latest.zip && rm commandlinetools-linux-11076708_latest.zip \
&& mkdir -p /usr/lib/android-sdk/cmdline-tools \
&& mv cmdline-tools /usr/lib/android-sdk/cmdline-tools/latest

ENV PATH="//usr/lib/android-sdk/cmdline-tools/latest/bin:${PATH}"
Expand All @@ -38,13 +42,11 @@ RUN mkdir scripts
COPY scripts/ scripts/
ENV PATH="/scripts/:${PATH}"

# Cache Gradle 8.2.1
RUN mkdir gradle-cache-tmp \
&& cd gradle-cache-tmp \
&& wget https://services.gradle.org/distributions/gradle-8.2.1-bin.zip \
&& unzip gradle-8.2.1-bin.zip \
&& touch settings.gradle \
&& gradle-8.2.1/bin/gradle wrapper --gradle-version 8.2.1 --distribution-type all \
&& ./gradlew \
&& cd .. \
&& rm -rf ./gradle-cache-tmp \
SHELL ["/bin/bash", "--login", "-c"]
ENV NODE_VERSION v20.11.0
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& source "$HOME/.nvm/nvm.sh" \
&& nvm install $NODE_VERSION
ENV PATH="//root/.nvm/versions/node/$NODE_VERSION/bin:${PATH}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ENV PATH="//root/.nvm/versions/node/$NODE_VERSION/bin:${PATH}"
ENV PATH="/root/.nvm/versions/node/$NODE_VERSION/bin:${PATH}"


RUN which npm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: what made npm be installed in that Docker image? Is it installed as part of the nvm install script (curl -o- …/nvm/v0.39.7/install.sh)?