Bootrstrapping androix repositoy in lite Dockerfile done right

This commit is contained in:
Shagen Ogandzhanian
2021-05-13 11:34:32 +02:00
parent 0eff77256a
commit ed495ea09e
3 changed files with 24 additions and 13 deletions

View File

@@ -47,3 +47,5 @@ WORKDIR androidx-main
COPY bootstrap.sh bootstrap.sh COPY bootstrap.sh bootstrap.sh
RUN chmod a+x bootstrap.sh RUN chmod a+x bootstrap.sh
ENTRYPOINT ./bootstrap.sh

View File

@@ -1,9 +1,23 @@
cd /androidx-main #!/bin/bash
~/bin/repo init -u https://android.googlesource.com/platform/manifest \
-b androidx-main --depth=1 --partial-clone --clone-filter=blob:limit=10M
~/bin/repo sync -c --no-tags --no-clone-bundle -j4
mkdir -p /mnt/agent function bootstrap() {
ln -sf /androidx-main/tools/ /mnt/agent/tools cd /androidx-main
ln -sf /androidx-main/prebuilts/ /mnt/agent/prebuilts ~/bin/repo init -u https://android.googlesource.com/platform/manifest \
ln -sf /androidx-main/external /mnt/agent/external -b androidx-main --depth=1 --partial-clone --clone-filter=blob:limit=10M
~/bin/repo sync -c --no-tags --no-clone-bundle -j4
mkdir -p /mnt/agent
ln -sf /androidx-main/tools/ /mnt/agent/tools
ln -sf /androidx-main/prebuilts/ /mnt/agent/prebuilts
ln -sf /androidx-main/external /mnt/agent/external
}
if [ ! -e /tmp/init ]; then
touch /tmp/init
echo "bootstrapping"
sleep 10
else
echo "not bootstrapping, all done"
fi
/bin/bash

View File

@@ -76,9 +76,4 @@ allprojects {
url("https://maven.pkg.jetbrains.space/public/p/compose/dev") url("https://maven.pkg.jetbrains.space/public/p/compose/dev")
} }
} }
task bootstrap(type: Exec) {
workingDir "/androidx-main"
commandLine "/androidx-main/bootstrap.sh"
}
} }