| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #!/bin/bash
- # Exit on any error
- set -e
- # Configuration
- IMAGE_NAME="chrome-builder"
- OUTPUT_DIR="$(pwd)/out"
- mkdir -p "$OUTPUT_DIR"
- echo "Building the 'Nicole Edition' Chrome AppImage..."
- # 1. Create the Dockerfile
- cat <<EOF > Dockerfile.chrome
- FROM ubuntu:22.04
- ENV DEBIAN_FRONTEND=noninteractive
- # Install essential build tools and dependencies
- RUN apt-get update && apt-get install -y \\
- wget curl file binutils desktop-file-utils \\
- libglib2.0-bin fakeroot libnss3 libatk1.0-0 \\
- libatk-bridge2.0-0 libcups2 libdrm2 libgbm1 \\
- libasound2 libpangocairo-1.0-0 libxkbcommon0 \\
- libgtk-3-0 squashfs-tools zsync ca-certificates
- # Grab the modern appimagetool
- RUN curl -L https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -o /usr/local/bin/appimagetool \\
- && chmod +x /usr/local/bin/appimagetool
- WORKDIR /build
- # The Build Logic:
- # 1. Download the latest deb
- # 2. Extract version and contents
- # 3. Relocate binary from /opt to /usr/bin
- # 4. Grab the 256px logo from the new Google path
- # 5. Create AppRun with the banner-killer flag (--test-type)
- CMD wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O chrome.deb && \\
- CHROME_VERSION=\$(dpkg-deb -f chrome.deb Version | cut -d- -f1) && \\
- echo "Fucking version found: \$CHROME_VERSION" && \\
- mkdir -p Chrome.AppDir/usr/bin && \\
- dpkg-deb -x chrome.deb Chrome.AppDir/ && \\
- cp -r Chrome.AppDir/opt/google/chrome/* Chrome.AppDir/usr/bin/ && \\
- # Fix the Icon: New location is inside the opt/google/chrome folder
- cp Chrome.AppDir/opt/google/chrome/product_logo_256.png Chrome.AppDir/google-chrome.png || touch Chrome.AppDir/google-chrome.png && \\
- # Create the AppRun with banner-suppression
- printf '#!/bin/sh\nHERE=\$(dirname \$(readlink -f "\${0}"))\nexport LD_LIBRARY_PATH="\${HERE}"/usr/lib:\$LD_LIBRARY_PATH\nexec "\${HERE}"/usr/bin/google-chrome --no-sandbox --test-type --no-first-run --password-store=basic "\$@"' > Chrome.AppDir/AppRun && \\
- chmod +x Chrome.AppDir/AppRun && \\
- # Create the Desktop entry
- printf "[Desktop Entry]\nName=Google Chrome\nExec=google-chrome\nIcon=google-chrome\nType=Application\nCategories=Network;WebBrowser;" > Chrome.AppDir/google-chrome.desktop && \\
- # Squash the bastard
- /usr/local/bin/appimagetool --appimage-extract-and-run Chrome.AppDir "/out/Google_Chrome-\${CHROME_VERSION}-x86_64.AppImage"
- EOF
- # 2. Build the Docker Image
- docker build -t "$IMAGE_NAME" -f Dockerfile.chrome .
- # 3. Run and map output
- # Mapping current out dir to container /out
- docker run --rm -v "$OUTPUT_DIR:/out" "$IMAGE_NAME"
- # 4. Cleanup
- rm Dockerfile.chrome
- echo "------------------------------------------------"
- echo "Build complete! Check the /out folder."
- echo "Remember to: chmod +x $OUTPUT_DIR/Google_Chrome-*.AppImage"
- ls -lh "$OUTPUT_DIR"
|