better cache in Dockerfile
This commit is contained in:
parent
c10a660585
commit
cb44bd5af6
3 changed files with 26 additions and 19 deletions
|
|
@ -16,8 +16,6 @@ RUN apt-get update && apt-get install -y \
|
||||||
# Create symlinks for the linker to ensure it's accessible
|
# Create symlinks for the linker to ensure it's accessible
|
||||||
RUN ln -sf /usr/bin/ld.lld /usr/bin/ld
|
RUN ln -sf /usr/bin/ld.lld /usr/bin/ld
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Configure cache directories
|
# Configure cache directories
|
||||||
ENV PUB_CACHE=/cache/pub-cache
|
ENV PUB_CACHE=/cache/pub-cache
|
||||||
ENV GRADLE_USER_HOME=/cache/gradle-cache
|
ENV GRADLE_USER_HOME=/cache/gradle-cache
|
||||||
|
|
@ -33,6 +31,16 @@ RUN chown -R $USER_ID:$GROUP_ID /sdks/flutter
|
||||||
|
|
||||||
USER $USER_ID:$GROUP_ID
|
USER $USER_ID:$GROUP_ID
|
||||||
|
|
||||||
|
# Pre-cache Flutter artifacts for Linux, Android, and Web to speed up subsequent builds
|
||||||
|
WORKDIR /dummy_app_only_for_cache
|
||||||
|
RUN flutter create . && flutter pub get
|
||||||
|
RUN flutter precache --linux
|
||||||
|
RUN flutter precache --android
|
||||||
|
RUN flutter precache --web
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
|
||||||
# Copy pubspec files and get dependencies
|
# Copy pubspec files and get dependencies
|
||||||
# Commented out to avoid building the app during image creation, this will be handled externally by makefile
|
# Commented out to avoid building the app during image creation, this will be handled externally by makefile
|
||||||
# COPY pubspec.yaml pubspec.lock ./
|
# COPY pubspec.yaml pubspec.lock ./
|
||||||
|
|
|
||||||
1
flutterw
1
flutterw
|
|
@ -110,7 +110,6 @@ exec_in_container(){
|
||||||
mkdir -p $BUILDCACHE/root-home/.config
|
mkdir -p $BUILDCACHE/root-home/.config
|
||||||
mkdir -p $BUILDCACHE/root-home/.local
|
mkdir -p $BUILDCACHE/root-home/.local
|
||||||
mkdir -p $BUILDCACHE/sdks-flutter-bin-cache
|
mkdir -p $BUILDCACHE/sdks-flutter-bin-cache
|
||||||
|
|
||||||
|
|
||||||
$DOCKER run \
|
$DOCKER run \
|
||||||
-it \
|
-it \
|
||||||
|
|
|
||||||
32
pubspec.lock
32
pubspec.lock
|
|
@ -468,26 +468,26 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker
|
name: leak_tracker
|
||||||
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
|
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "11.0.2"
|
version: "10.0.9"
|
||||||
leak_tracker_flutter_testing:
|
leak_tracker_flutter_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker_flutter_testing
|
name: leak_tracker_flutter_testing
|
||||||
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
|
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.10"
|
version: "3.0.9"
|
||||||
leak_tracker_testing:
|
leak_tracker_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker_testing
|
name: leak_tracker_testing
|
||||||
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
|
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.2"
|
version: "3.0.1"
|
||||||
linked_scroll_controller:
|
linked_scroll_controller:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -540,10 +540,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
|
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.17.0"
|
version: "1.16.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -881,26 +881,26 @@ packages:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: test
|
name: test
|
||||||
sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7"
|
sha256: "301b213cd241ca982e9ba50266bd3f5bd1ea33f1455554c5abb85d1be0e2d87e"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.26.3"
|
version: "1.25.15"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
|
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.7"
|
version: "0.7.4"
|
||||||
test_core:
|
test_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_core
|
name: test_core
|
||||||
sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0"
|
sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.12"
|
version: "0.6.8"
|
||||||
timing:
|
timing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -1025,10 +1025,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
|
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.0"
|
version: "2.1.4"
|
||||||
vm_service:
|
vm_service:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue