chore(dockerFile): dual android sdk installation and conflicts#2069
Conversation
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…n them. This Commit, comments out certain Docker commands in dockerFile as it's used inside devcontainers too, which are not needed when using dev containers. But those should be uncommented for Standalone Docker Build in the dockerFile.
Greptile SummaryThis PR refactors the Confidence Score: 5/5Safe to merge; the multi-stage refactor is structurally sound and the only finding is a minor P2 maintenance concern in devcontainer.json. Only P2 findings present (hardcoded build-tools version in remoteEnv PATH). All previously raised P1 concerns are resolved: GRADLE_VERSION is now declared inside the base stage, and ARG inheritance across child stages is handled correctly per the custom rule. No P0/P1 issues identified. .devcontainer/devcontainer.json — the hardcoded 36.0.0 in remoteEnv.PATH should be kept in sync with the build_tools feature option. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["FROM java:1-21-bullseye AS base\n(Gradle, apt deps, WORKDIR)"] --> B["FROM base AS devcontainer\n(empty – features handle SDK + Node)"]
A --> C["FROM base AS standalone\n(Android SDK + fnm + Node + pnpm)"]
B --> D["devcontainer.json\n(target: devcontainer)\nFeatures: android-sdk, node"]
C --> E["docker build --target standalone\n(CONTRIBUTING.md Option 2)"]
D --> F["remoteEnv injects\nANDROID_SDK_ROOT + PATH\n(build-tools/36.0.0 hardcoded ⚠️)"]
Reviews (9): Last reviewed commit: "fix(CONTRIBUTING.md): `Podmon` to Podman..." | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
Updated Docker build command to specify the 'standalone' target.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@greptileai As per this wording of Variable Scoping from Docker Docs; it should work: Build arguments declared in the global scope of a Dockerfile aren't automatically inherited into the build stages. They're only accessible in the global scope. # syntax=docker/dockerfile:1
# The following build argument is declared in the global scope:
ARG NAME="joe"
FROM alpine
# The following instruction doesn't have access to the $NAME build argument
# because the argument was defined in the global scope, not for this stage.
RUN echo "hello ${NAME}!"The # syntax=docker/dockerfile:1
# Declare the build argument in the global scope
ARG NAME="joe"
FROM alpine
# Consume the build argument in the build stage
ARG NAME
RUN echo $NAMEOnce a build argument is declared or consumed in a stage, it's automatically inherited by child stages. # syntax=docker/dockerfile:1
FROM alpine AS base
# Declare the build argument in the build stage
ARG NAME="joe"
# Create a new stage based on "base"
FROM base AS build
# The NAME build argument is available here
# since it's declared in a parent stage
RUN echo "hello $NAME!" |
This comment has been minimized.
This comment has been minimized.
Mentioning about containers/buildah#5845
This comment has been minimized.
This comment has been minimized.
|
@greptile fixed the typo. |
This PR refactors the
.devcontainer/Dockerfilefrom a single-stage build into a three-stage multi-stage build (base → devcontainer / standalone), eliminating the previous conflict where Android SDK was installed twice when used as a devcontainer. Thedevcontainertarget is intentionally lean (SDK and Node provided by devcontainer features), whilestandaloneself-installs both.CONTRIBUTING.mdis updated with the new--target standalonebuild command and a Podman compatibility note.