HUB
Sign inSign up

skycoder42/sbx-kit-flutter-web:latest

Multi-platform
Manifest digest

sha256:024690fa0f37430543c9295a31c9f5430fa87bef6604151b823d0207551f16f2

Last pushed

3 days by skycoder42

Type

Sandbox Kit

Manifest digest

sha256:024690fa0f37430543c9295a31c9f5430fa87bef6604151b823d0207551f16f2

yaml
schemaVersion: "3"
displayName: Flutter web toolchain
author: Skycoder42
description: 'Chromium and chromedriver for `flutter test --platform chrome` and web integration tests, installed with apt when the sandbox is created. Declaration-only: it adds no layer and needs a Debian-based workload. Flutter and the related logo are trademarks of Google LLC. This kit is not endorsed by or affiliated with Google LLC.'
sourceUrl: https://github.com/Skycoder42/dart_test_tools/tree/main/sbx/flutter-web
version: 1.0.0
licenses:
    - BSD-3-Clause
kind: mixin
provides:
    - [email protected]
requires:
    - flutter
capabilities:
    - type: com.docker.sandbox/network-policy@2
      config:
        install:
            allow:
                - deb.debian.org
                - dhi.io
    - type: com.docker.sandbox/lifecycle@1
      config:
        install:
            - command: |
                if ! command -v apt-get > /dev/null 2>&1; then
                  echo "flutter-web: this kit needs a Debian-based workload with apt-get" >&2
                  exit 1
                fi
                export DEBIAN_FRONTEND=noninteractive
                apt-get update -qq
                apt-get install -y -qq --no-install-recommends \
                  chromium chromium-driver fonts-liberation
                rm -rf /var/lib/apt/lists/*
                # Flutter looks for `google-chrome` on Linux. A link instead of
                # CHROME_EXECUTABLE needs no image layer and reaches non-login shells.
                if ! command -v google-chrome > /dev/null 2>&1; then
                  ln -s /usr/bin/chromium /usr/local/bin/google-chrome
                fi
              description: Install Chromium for Flutter web
              user: "0"
    - type: com.docker.sandbox/agent-context@1
      optional: true
      config:
        content: |
            ## Flutter web
            Chromium is installed (also as `google-chrome`), so
            `flutter test --platform chrome` and `flutter build web` work. The sandbox
            has no display: browser tests run headless. For web integration tests start
            `chromedriver --port=4444 &` and run
            `flutter drive --driver test_driver/integration_test.dart --target integration_test/<test>.dart -d web-server --browser-name chrome --headless`.
    - type: com.docker.sandbox/agent-context@2
      optional: true
      config:
        content: |
            ## Flutter web
            Chromium is installed (also as `google-chrome`), so
            `flutter test --platform chrome` and `flutter build web` work. The sandbox
            has no display: browser tests run headless. For web integration tests start
            `chromedriver --port=4444 &` and run
            `flutter drive --driver test_driver/integration_test.dart --target integration_test/<test>.dart -d web-server --browser-name chrome --headless`.