Skip to content

Commit 0455f86

Browse files
chore(devcontainer): fix dockerfile broken yarn repo in base image (#2065)
This PR fixes the broken Yarn APT repository present in the mcr.microsoft.com/devcontainers/java:1-21-bullseye base image by removing /etc/apt/sources.list.d/yarn.list before running apt-get update, and migrates the devcontainer config from a bare image reference to a Dockerfile build. It also bumps the Android platform and build-tools from 35 → 36, removes the redundant Java devcontainer feature, and delegates Node.js installation to the ghcr.io/devcontainers/features/node:1 feature (commenting out the previous fnm-based install) * chore(devcontainer): fix dockerfile broken yarn repo in base image * Update .devcontainer/devcontainer.json Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update Dockerfile * Update devcontainer.json * Update Dockerfile * Update devcontainer.json * remove: redundant pnpm installation. --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 9051211 commit 0455f86

2 files changed

Lines changed: 30 additions & 25 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye
99

10-
ARG ANDROID_PLATFORM=35
11-
ARG ANDROID_BUILD_TOOLS=35.0.0
10+
ARG ANDROID_PLATFORM=36
11+
ARG ANDROID_BUILD_TOOLS=36.0.0
1212
ARG CMDLINE_TOOLS_VERSION=11076708
1313
ARG NODE_VERSION=22
1414
ARG GRADLE_VERSION=8.11
@@ -18,9 +18,13 @@ ENV ANDROID_SDK_ROOT=/opt/android-sdk
1818
ENV GRADLE_HOME=/opt/gradle
1919
ENV PATH="${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${GRADLE_HOME}/bin"
2020

21+
# removes broken yarn repo present in base image
22+
RUN rm -f /etc/apt/sources.list.d/yarn.list
23+
2124
RUN apt-get update && apt-get install -y --no-install-recommends \
2225
wget \
2326
unzip \
27+
curl \
2428
&& rm -rf /var/lib/apt/lists/*
2529

2630
# Install Gradle
@@ -30,15 +34,16 @@ RUN wget -q "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-
3034
&& ln -s /opt/gradle-${GRADLE_VERSION} ${GRADLE_HOME}
3135

3236
# Install fnm and Node.js
33-
ENV FNM_DIR=/usr/local/fnm
34-
ENV PATH="${FNM_DIR}:${PATH}"
35-
RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "${FNM_DIR}" --skip-shell \
36-
&& eval "$(${FNM_DIR}/fnm env)" \
37-
&& fnm install ${NODE_VERSION} \
38-
&& fnm default ${NODE_VERSION} \
39-
&& npm install -g pnpm
40-
41-
ENV PATH="${FNM_DIR}/aliases/default/bin:${PATH}"
37+
# Not required, mostly. When dev containers are used.
38+
# ENV FNM_DIR=/usr/local/fnm
39+
# ENV PATH="${FNM_DIR}:${PATH}"
40+
# RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "${FNM_DIR}" --skip-shell \
41+
# && eval "$(${FNM_DIR}/fnm env)" \
42+
# && fnm install ${NODE_VERSION} \
43+
# && fnm default ${NODE_VERSION} \
44+
# && npm install -g pnpm
45+
46+
# ENV PATH="${FNM_DIR}/aliases/default/bin:${PATH}"
4247

4348
# Install Android SDK
4449
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \

.devcontainer/devcontainer.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"name": "Acode Development",
3-
"image": "mcr.microsoft.com/devcontainers/java:1-21-bullseye",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
7+
"containerEnv": {
8+
"JAVA_HOME": "/usr/local/openjdk-21"
9+
},
10+
"remoteEnv": {
11+
"JAVA_HOME": "/usr/local/openjdk-21"
12+
},
413

514
"features": {
6-
"ghcr.io/devcontainers/features/java:1": {
7-
"installGradle": true,
8-
"installGroovy": false,
9-
"installMaven": false,
10-
"installAnt": false,
11-
"version": "21",
12-
"jdkDistro": "ms",
13-
"gradleVersion": "latest"
14-
},
1515
"ghcr.io/nordcominc/devcontainer-features/android-sdk:1": {
16-
"platform": "35",
17-
"build_tools": "35.0.0"
16+
"platform": "36",
17+
"build_tools": "36.0.0"
1818
},
1919
"ghcr.io/devcontainers/features/node:1": {
2020
"nodeGypDependencies": false,
@@ -24,9 +24,9 @@
2424
"nvmVersion": "latest"
2525
}
2626
},
27-
27+
"overrideCommand": true,
2828
"postCreateCommand": "pnpm run setup",
29-
29+
"remoteUser": "root",
3030
"customizations": {
3131
"vscode": {
3232
"extensions": ["biomejs.biome", "redhat.java"],

0 commit comments

Comments
 (0)