chore: add codium/vscode devcontainer

This commit is contained in:
Daniel Giritzer
2025-09-08 11:47:30 +02:00
committed by Arjan Schrijver
parent 968f9405d6
commit edae741b26
4 changed files with 94 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
FROM ghcr.io/alvr/alpine-android:android-33-jdk21
ARG USERNAME=developer
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN apk --no-cache add git \
sudo \
nano \
bash \
bash-completion && \
# setup sudo user and permissions
addgroup -g $USER_GID $USERNAME && \
adduser -u $USER_UID -G $USERNAME $USERNAME --disabled-password -s /bin/bash && \
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME && \
echo $USERNAME:10000:5000 > /etc/subuid; \
echo $USERNAME:10000:5000 > /etc/subgid; \
chown -R developer:developer /opt/sdk/
USER $USERNAME
# configure environment
RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)" && \
# setup editor
echo "export EDITOR=/usr/bin/nano" >> ~/.bashrc
+25
View File
@@ -0,0 +1,25 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"adelphes.android-dev-ext",
"vscjava.vscode-java-pack"
]
}
},
"mounts": [
"source=${localEnv:HOME}/.android,target=/home/developer/.android,type=bind,consistency=cached"
],
"runArgs": [
"--init",
"--network=host",
"--device=/dev/bus/usb",
"--privileged",
// "--userns=keep-id" // needed if podman is used instead of docker
],
"postStartCommand": "sudo chown -R developer:developer /opt/sdk/",
"initializeCommand": "mkdir -p ${localEnv:HOME}/.android" // make sure folder exists so that bind mount does not fail
}
+6
View File
@@ -0,0 +1,6 @@
{
"recommendations": [
"adelphes.android-dev-ext",
"vscjava.vscode-java-pack"
]
}
+37
View File
@@ -0,0 +1,37 @@
{
"launch": {
"version": "0.2.0",
"configurations": [
{
"type": "android",
"request": "launch",
"name": "Launch App",
"appSrcRoot": "${workspaceRoot}/app/src/main",
"apkFile": "${workspaceRoot}/app/build/outputs/apk/mainline/debug/app-mainline-debug.apk",
"adbSocket": "localhost:5037",
"autoStartADB": true,
"staleBuild": "warn",
"targetDevice": "${command:PickAndroidDevice}",
"manifestFile": "${workspaceRoot}/app/src/main/AndroidManifest.xml",
"pmInstallArgs": [
"-r"
],
"amStartArgs": [
"-D",
"--activity-brought-to-front",
"-a android.intent.action.MAIN",
"-c android.intent.category.LAUNCHER",
"-n nodomain.freeyourgadget.gadgetbridge/nodomain.freeyourgadget.gadgetbridge.activities.ControlCenterv2"
],
"postLaunchPause": 10000,
"trace": true
}
],
"compounds": []
},
"java.jdt.ls.androidSupport.enabled": "on",
// -- Auto format code with a provided rule set:
// "editor.formatOnSave": true,
// "java.format.settings.url": "https://raw.githubusercontent.com/android/platform_development/master/ide/eclipse/android-formatting.xml",
// "java.format.enabled": true
}