Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!Dockerfile
96 changes: 61 additions & 35 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,79 @@ name: Docker Image

on:
schedule:
- cron: "0 10 * * *" # everyday at 10am
- cron: '37 10 * * 1'
workflow_dispatch:
pull_request:
branches: ["latest"]
branches: [latest]
push:
branches: ["latest"]
tags: ["v*.*.*"]
branches: [latest]
tags: ['v*.*.*']

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
platforms: linux/amd64
IMAGE_NAME: beevelop/android-nodejs
LOCAL_IMAGE: android-nodejs:test
PUBLISH: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/latest' || (github.event_name == 'push' && github.ref_type == 'tag')) }}

jobs:
main:
runs-on: ubuntu-22.04
timeout-minutes: 30
runs-on: ubuntu-24.04
timeout-minutes: 25
steps:
- name: Check out the repo
uses: actions/checkout@v7
with:
ref: ${{ github.head_ref || github.ref }}
- name: Set imageName based on the repository name
id: step_one
run: |
imageName="${GITHUB_REPOSITORY/docker-/}"
echo $imageName
echo "imageName=$imageName" >> $GITHUB_ENV
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v6
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
images: ${{ env.imageName }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to DockerHub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v4.8.0
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Generate image tags and labels
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: ${{ env.IMAGE_NAME }}
- name: Build image for smoke test
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
platforms: linux/amd64
load: true
tags: ${{ env.LOCAL_IMAGE }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=android-nodejs-amd64
no-cache: ${{ github.event_name == 'schedule' }}
- name: Check installed tools
run: |
docker run --rm --network none "$LOCAL_IMAGE" sh -ec '
java -version
sdkmanager --version
gradle --version
test "$(node --version)" = "v$NODE_VERSION"
npm --version
test "$(yarn --version)" = "$YARN_VERSION"
test "$(yarnpkg --version)" = "$YARN_VERSION"
'
- name: Log in to Docker Hub
if: env.PUBLISH == 'true'
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v7
- name: Publish verified image
id: publish
if: env.PUBLISH == 'true'
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
platforms: ${{ env.platforms }}
push: ${{ github.event_name != 'pull_request' }}
pull: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: mode=min
sbom: true
cache-to: type=gha,scope=android-nodejs-amd64,mode=max,ignore-error=true
61 changes: 36 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,41 @@
FROM beevelop/android
# syntax=docker/dockerfile:1
ARG ANDROID_IMAGE=android-parent
FROM beevelop/android:latest@sha256:a6497d871daceaf8e4244fb1c3dcc0d475d6dd94e8ec3611809c92d0b156cbbf AS android-parent
FROM ${ANDROID_IMAGE}

LABEL maintainer="hi@beevelop.com" \
org.label-schema.schema-version="1.0" \
org.label-schema.name="Beevelop Android + Node.js Image" \
org.label-schema.description="Android SDK with Node.js, npm, and yarn - based on beevelop/android." \
org.label-schema.vendor="Maik Hummel (beevelop)" \
org.label-schema.url="https://github.com/beevelop/docker-android-nodejs" \
org.label-schema.usage="https://github.com/beevelop/docker-android-nodejs/blob/latest/README.md" \
org.label-schema.vcs-url="https://github.com/beevelop/docker-android-nodejs.git" \
org.label-schema.license="MIT" \
org.opencontainers.image.title="Beevelop Android + Node.js Image" \
org.opencontainers.image.description="Android SDK with Node.js, npm, and yarn - based on beevelop/android." \
LABEL org.opencontainers.image.title="Beevelop Android + Node.js Image" \
org.opencontainers.image.description="Android SDK with Node.js, npm and Yarn Classic." \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.authors="Maik Hummel (beevelop)" \
org.opencontainers.image.vendor="Maik Hummel (beevelop)" \
org.opencontainers.image.url="https://github.com/beevelop/docker-android-nodejs" \
org.opencontainers.image.documentation="https://github.com/beevelop/docker-android-nodejs/blob/latest/README.md" \
org.opencontainers.image.source="https://github.com/beevelop/docker-android-nodejs.git"
org.opencontainers.image.source="https://github.com/beevelop/docker-android-nodejs"

# Install Node.js 24 (Active LTS) with compatible npm using official Node.js binaries
ENV NODE_VERSION=24.18.0
RUN apt-get update && apt-get install -y curl ca-certificates xz-utils && \
curl -fsSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz | tar -xJ -C /usr/local --strip-components=1 && \
npm install -g npm@latest && \
npm install -g yarn && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
node -v && npm -v && yarn -v && \
mvn -v && gradle -v && java -version && ant -version
ENV NODE_VERSION=24.23.0 \
YARN_VERSION=1.22.22

# Keep these checksums in sync with the pinned Node.js and Yarn releases.
ARG NODE_SHA256=87245483164e626bcc267117435d5642609c53df37a26cc51d9545cc9956b49a
ARG YARN_SHA256=c17d3797fb9a9115bf375e31bfd30058cac6bc9c3b8807a3d8cb2094794b51ca
ARG TARGETARCH

# Preserve the npm version bundled with Node.js for this release.
RUN set -eu; \
test "$TARGETARCH" = amd64; \
tmp_dir="$(mktemp -d)"; \
trap 'rm -rf "$tmp_dir"' EXIT; \
curl --fail --silent --show-error --location --retry 3 \
"https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" \
--output "$tmp_dir/node.tar.gz"; \
printf '%s %s\n' "$NODE_SHA256" "$tmp_dir/node.tar.gz" | sha256sum --check --strict; \
tar -xzf "$tmp_dir/node.tar.gz" -C /usr/local --strip-components=1 --no-same-owner; \
curl --fail --silent --show-error --location --retry 3 \
"https://registry.npmjs.org/yarn/-/yarn-${YARN_VERSION}.tgz" \
--output "$tmp_dir/yarn.tgz"; \
printf '%s %s\n' "$YARN_SHA256" "$tmp_dir/yarn.tgz" | sha256sum --check --strict; \
mkdir -p /opt/yarn; \
tar -xzf "$tmp_dir/yarn.tgz" -C /opt/yarn --strip-components=1 --no-same-owner; \
ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn; \
ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg; \
test "$(node --version)" = "v${NODE_VERSION}"; \
npm --version; \
test "$(yarn --version)" = "$YARN_VERSION"
Loading