mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
CICD: Improve the Android Docker Image Build.
Introduce proper reuse of intermediary stages in the multi-stage build. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
bef21ff5eb
commit
6dd5922d15
2 changed files with 10 additions and 21 deletions
4
.github/workflows/android-dockerimage.yml
vendored
4
.github/workflows/android-dockerimage.yml
vendored
|
@ -3,8 +3,8 @@ name: Android Docker Image CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- scripts/docker/android-build-container
|
- scripts/docker/android-build-container/**
|
||||||
- .github/workflows/android-docker*
|
- .github/workflows/android-dockerimage.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
android-build-container:
|
android-build-container:
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
FROM subsurface/android-build-container:5.15.1 as base
|
FROM ubuntu:22.04 as base
|
||||||
|
|
||||||
FROM ubuntu:22.04 as build
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get upgrade -y && \
|
apt-get upgrade -y && \
|
||||||
|
@ -11,12 +9,16 @@ RUN apt-get update && \
|
||||||
autoconf \
|
autoconf \
|
||||||
libtool-bin \
|
libtool-bin \
|
||||||
openjdk-8-jdk \
|
openjdk-8-jdk \
|
||||||
wget
|
wget && \
|
||||||
|
apt-get clean
|
||||||
|
|
||||||
|
|
||||||
|
FROM base as build
|
||||||
|
|
||||||
WORKDIR /android
|
WORKDIR /android
|
||||||
|
|
||||||
# Scrape the manually curated Qt install from the previous build image
|
# Scrape the manually curated Qt install from the previous build image
|
||||||
COPY --from=base /android/5.15.1 5.15.1
|
COPY --from=subsurface/android-build-container:5.15.1 /android/5.15.1 5.15.1
|
||||||
|
|
||||||
# install, NDK and SDK there, plus the three files from the Subsurface
|
# install, NDK and SDK there, plus the three files from the Subsurface
|
||||||
# sources that we need to get the prep routines to run
|
# sources that we need to get the prep routines to run
|
||||||
|
@ -64,19 +66,8 @@ RUN rm -rf \
|
||||||
android-build-setup.sh \
|
android-build-setup.sh \
|
||||||
/usr/lib/gcc
|
/usr/lib/gcc
|
||||||
|
|
||||||
FROM ubuntu:22.04
|
|
||||||
|
|
||||||
# Repeat exactly the same step as in the 'build' image above, so it can be reused
|
FROM base as final
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get upgrade -y && \
|
|
||||||
apt-get install -y \
|
|
||||||
unzip \
|
|
||||||
git \
|
|
||||||
cmake \
|
|
||||||
autoconf \
|
|
||||||
libtool-bin \
|
|
||||||
openjdk-8-jdk \
|
|
||||||
wget
|
|
||||||
|
|
||||||
RUN apt-get install -y \
|
RUN apt-get install -y \
|
||||||
autoconf \
|
autoconf \
|
||||||
|
@ -107,5 +98,3 @@ COPY --from=build /android/ .
|
||||||
RUN git config --global --add safe.directory /android/subsurface && \
|
RUN git config --global --add safe.directory /android/subsurface && \
|
||||||
git config --global --add safe.directory /android/subsurface/libdivecomputer && \
|
git config --global --add safe.directory /android/subsurface/libdivecomputer && \
|
||||||
git config --global --add safe.directory /android/subsurface/nightly-builds
|
git config --global --add safe.directory /android/subsurface/nightly-builds
|
||||||
|
|
||||||
RUN touch finished-"`date`"
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue