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
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,9 @@ ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_SDK_URL=https://dl.google.com/android/repository/commandlinetools-linux-${CMDLINE_TOOLS_VERSION}_latest.zip
ENV PATH=${ANDROID_HOME}/cmdline-tools/bin:${ANDROID_HOME}/platform-tools:${PATH}

# Runtime deps for build-tools/aapt2.
RUN DPKG_ARCH=$(dpkg --print-architecture) && \
apt-get update && \
apt-get install -y --no-install-recommends \
libc6:${DPKG_ARCH} \
libstdc++6:${DPKG_ARCH} \
zlib1g:${DPKG_ARCH} \
libtinfo6:${DPKG_ARCH} \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Runtime deps for build-tools on arm64, amd64 libs are needed for x86_64-only binary (aapt2 etc) under emulation.
COPY scripts/setup-multiarch-apt.sh /usr/local/bin/setup-multiarch-apt
RUN /usr/local/bin/setup-multiarch-apt

# Install just from a pinned release.
RUN case ${TARGETARCH} in \
Expand Down
2 changes: 1 addition & 1 deletion core
Submodule core updated 154 files
13 changes: 10 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ build-base-image:
TAG := env("TAG", "main")
BUILD_MODE := env("BUILD_MODE", "")
BUNDLE_TASK := env("BUNDLE_TASK", "clean :app:bundleGoogleRelease assembleUniversalRelease")
DOCKER_PLATFORM := env("DOCKER_PLATFORM", "linux/amd64")
OUTPUTS_DIR := env("OUTPUTS_DIR", "")
GRADLE_WORKERS_MAX := env("GRADLE_WORKERS_MAX", "4")

build-app-image:
Expand All @@ -58,9 +60,9 @@ build-app-image:
tag="{{TAG}}"
if ! docker pull ghcr.io/gemwalletcom/gem-android-base:${base_tag} >/dev/null 2>&1; then
echo "Base image ghcr.io/gemwalletcom/gem-android-base:${base_tag} not found; building locally..." >&2
DOCKER_BUILDKIT=1 DOCKER_DEFAULT_PLATFORM=linux/amd64 docker build --platform linux/amd64 -t ghcr.io/gemwalletcom/gem-android-base:${base_tag} .
DOCKER_BUILDKIT=1 DOCKER_DEFAULT_PLATFORM="{{DOCKER_PLATFORM}}" docker build --platform "{{DOCKER_PLATFORM}}" -t ghcr.io/gemwalletcom/gem-android-base:${base_tag} .
fi
DOCKER_BUILDKIT=1 DOCKER_DEFAULT_PLATFORM=linux/amd64 docker build --platform linux/amd64 \
DOCKER_BUILDKIT=1 DOCKER_DEFAULT_PLATFORM="{{DOCKER_PLATFORM}}" docker build --platform "{{DOCKER_PLATFORM}}" \
--build-arg TAG="${tag}" \
--build-arg SKIP_SIGN=true \
--build-arg BUNDLE_TASK="${BUNDLE_TASK}" \
Expand All @@ -78,15 +80,20 @@ build-app-in-docker:
container_name="gem-android-app-build"
gradle_cache=$(mktemp -d)
maven_cache=$(mktemp -d)
outputs_dir="{{OUTPUTS_DIR}}"
trap 'rm -rf "${gradle_cache}" "${maven_cache}"; docker rm -f ${container_name} >/dev/null 2>&1 || true' EXIT
docker rm -f ${container_name} >/dev/null 2>&1 || true
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --platform linux/amd64 --name ${container_name} \
DOCKER_DEFAULT_PLATFORM="{{DOCKER_PLATFORM}}" docker run --platform "{{DOCKER_PLATFORM}}" --name ${container_name} \
-e SKIP_SIGN=true \
-e BUNDLE_TASK="${BUNDLE_TASK}" \
-v "${gradle_cache}":/root/.gradle \
-v "${maven_cache}":/root/.m2 \
gem-android-app-verify \
bash -lc 'cd /root/gem-android && ./gradlew ${BUNDLE_TASK} --no-daemon --build-cache -Dorg.gradle.workers.max={{GRADLE_WORKERS_MAX}}'
if [ -n "${outputs_dir}" ]; then
mkdir -p "${outputs_dir}"
docker cp "${container_name}":/root/gem-android/app/build/outputs/. "${outputs_dir}/"
fi

core-upgrade:
@git submodule update --recursive --remote
Expand Down
2 changes: 1 addition & 1 deletion reproducible/base_image_tag.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
base-2026-01-30
base-2026-02-04
48 changes: 48 additions & 0 deletions scripts/setup-multiarch-apt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -euo pipefail

arch="$(dpkg --print-architecture)"
extra=""

if [ "$arch" = "arm64" ]; then
dpkg --add-architecture amd64

if ! grep -q '^Architectures:' /etc/apt/sources.list.d/ubuntu.sources; then
sed -i '/^Types: deb$/a Architectures: arm64' /etc/apt/sources.list.d/ubuntu.sources
fi

. /etc/os-release
codename="${VERSION_CODENAME:-${UBUNTU_CODENAME:-}}"
if [ -z "$codename" ]; then
echo "Missing Ubuntu codename in /etc/os-release" >&2
exit 1
fi

cat > /etc/apt/sources.list.d/ubuntu-amd64.sources <<EOF
Types: deb
URIs: http://archive.ubuntu.com/ubuntu
Suites: ${codename} ${codename}-updates ${codename}-backports
Components: main universe restricted multiverse
Architectures: amd64
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://archive.ubuntu.com/ubuntu
Suites: ${codename}-security
Components: main universe restricted multiverse
Architectures: amd64
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
EOF

extra="libc6:amd64 libstdc++6:amd64 zlib1g:amd64 libtinfo6:amd64 libgcc-s1:amd64"
fi

apt-get update
apt-get install -y --no-install-recommends \
libc6:${arch} \
libstdc++6:${arch} \
zlib1g:${arch} \
libtinfo6:${arch} \
ca-certificates \
${extra}
rm -rf /var/lib/apt/lists/*
Loading