Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b2e4c09c2b |
+4
-13
@@ -8,21 +8,12 @@ LABEL org.opencontainers.image.version="${FLUTTER_VERSION}"
|
|||||||
|
|
||||||
USER 0
|
USER 0
|
||||||
|
|
||||||
# Download Flutter SDK and strip unnecessary files in a single layer
|
# Clone Flutter SDK from git (supports both amd64 and arm64)
|
||||||
RUN curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz" \
|
RUN git clone --depth 1 --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git /opt/flutter && \
|
||||||
-o /tmp/flutter.tar.xz && \
|
git config --global --add safe.directory /opt/flutter && \
|
||||||
tar xf /tmp/flutter.tar.xz -C /opt && \
|
rm -rf /opt/flutter/dev /opt/flutter/examples && \
|
||||||
rm /tmp/flutter.tar.xz && \
|
|
||||||
rm -rf /opt/flutter/dev \
|
|
||||||
/opt/flutter/examples \
|
|
||||||
/opt/flutter/bin/cache/artifacts/engine/android-* \
|
|
||||||
/opt/flutter/bin/cache/artifacts/engine/linux-* && \
|
|
||||||
chown -R 65532:65532 /opt/flutter
|
chown -R 65532:65532 /opt/flutter
|
||||||
|
|
||||||
# Mark git directory as safe and compact git history
|
|
||||||
RUN git config --global --add safe.directory /opt/flutter && \
|
|
||||||
cd /opt/flutter && git gc --prune=all
|
|
||||||
|
|
||||||
USER 65532
|
USER 65532
|
||||||
|
|
||||||
# Configure for web-only (disable everything else)
|
# Configure for web-only (disable everything else)
|
||||||
|
|||||||
+4
-12
@@ -30,18 +30,10 @@ RUN mkdir -p "${ANDROID_HOME}/cmdline-tools" && \
|
|||||||
# Remove lint-psi to eliminate protobuf-java 2.6.1 CVEs (saves 86MB)
|
# Remove lint-psi to eliminate protobuf-java 2.6.1 CVEs (saves 86MB)
|
||||||
rm -rf "${ANDROID_HOME}/cmdline-tools/latest/lib/external/lint-psi"
|
rm -rf "${ANDROID_HOME}/cmdline-tools/latest/lib/external/lint-psi"
|
||||||
|
|
||||||
# Download Flutter SDK and strip unnecessary files
|
# Clone Flutter SDK from git (supports both amd64 and arm64)
|
||||||
RUN curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz" \
|
RUN git clone --depth 1 --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git /opt/flutter && \
|
||||||
-o /tmp/flutter.tar.xz && \
|
git config --global --add safe.directory /opt/flutter && \
|
||||||
tar xf /tmp/flutter.tar.xz -C /opt && \
|
rm -rf /opt/flutter/dev /opt/flutter/examples
|
||||||
rm /tmp/flutter.tar.xz && \
|
|
||||||
rm -rf /opt/flutter/dev \
|
|
||||||
/opt/flutter/examples \
|
|
||||||
/opt/flutter/bin/cache/artifacts/engine/linux-* \
|
|
||||||
/opt/flutter/bin/cache/flutter_web_sdk
|
|
||||||
|
|
||||||
RUN git config --global --add safe.directory /opt/flutter && \
|
|
||||||
cd /opt/flutter && git gc --prune=all
|
|
||||||
|
|
||||||
# Fix ownership before switching to flutter user
|
# Fix ownership before switching to flutter user
|
||||||
RUN chown -R 65532:65532 /opt/flutter "${ANDROID_HOME}"
|
RUN chown -R 65532:65532 /opt/flutter "${ANDROID_HOME}"
|
||||||
|
|||||||
+4
-12
@@ -8,18 +8,10 @@ LABEL org.opencontainers.image.version="${FLUTTER_VERSION}"
|
|||||||
|
|
||||||
USER 0
|
USER 0
|
||||||
|
|
||||||
# Download Flutter SDK and strip unnecessary files
|
# Clone Flutter SDK from git (supports both amd64 and arm64)
|
||||||
RUN curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz" \
|
RUN git clone --depth 1 --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git /opt/flutter && \
|
||||||
-o /tmp/flutter.tar.xz && \
|
git config --global --add safe.directory /opt/flutter && \
|
||||||
tar xf /tmp/flutter.tar.xz -C /opt && \
|
rm -rf /opt/flutter/dev /opt/flutter/examples
|
||||||
rm /tmp/flutter.tar.xz && \
|
|
||||||
rm -rf /opt/flutter/dev \
|
|
||||||
/opt/flutter/examples \
|
|
||||||
/opt/flutter/bin/cache/artifacts/engine/android-* \
|
|
||||||
/opt/flutter/bin/cache/flutter_web_sdk
|
|
||||||
|
|
||||||
RUN git config --global --add safe.directory /opt/flutter && \
|
|
||||||
cd /opt/flutter && git gc --prune=all
|
|
||||||
|
|
||||||
# Fix ownership before switching to flutter user
|
# Fix ownership before switching to flutter user
|
||||||
RUN chown -R 65532:65532 /opt/flutter
|
RUN chown -R 65532:65532 /opt/flutter
|
||||||
|
|||||||
Reference in New Issue
Block a user