Sign inSign up

christopherpetito053/demo-mixin:v3

Multi-platform
Manifest digest

sha256:f2a1ac60f0f1db58610585de0966acc0ccfca1edaf6eca862bfcd8085f841b31

Last pushed

17 days by christopherpetito053

Type

Sandbox Kit

Manifest digest

sha256:f2a1ac60f0f1db58610585de0966acc0ccfca1edaf6eca862bfcd8085f841b31

yaml
schemaVersion: "3"
displayName: Demo mixin
description: Overlay and lifecycle fixture for mixin-emulation demos
sourceUrl: https://github.com/docker/public-api/tree/main/examples/kits/demo-mixin
version: 1.0.0
kind: mixin
provides:
    - [email protected]
integrates:
    - demo-workload >= 1.0.0
capabilities:
    - type: com.docker.sandbox/lifecycle@1
      config:
        files:
            - content: |
                DEMO_MIXIN_SETTINGS=managed-by-kit
              description: Rewritten on every start
              mode: "0644"
              overwrite: true
              path: /home/agent/.config/demo-mixin/settings.env
            - content: |
                Edit me: restarts keep your edits.
              description: Seeded once; user edits survive
              overwrite: false
              path: /home/agent/.config/demo-mixin/notes.txt
        install:
            - command: |
                mkdir -p /var/lib/demo
                printf '%s uid=%s DEMO_MIXIN=%s\n' "$(date -u +%Y-%m-%dT%H:%M:%S.%NZ)" "$(id -u)" "${DEMO_MIXIN:-<unset>}" > /var/lib/demo/mixin-install-root
              description: Root install marker; declares DEMO_MIXIN so it sees it
              env:
                - DEMO_MIXIN
              user: "0"
            - command: |
                mkdir -p /home/agent/.local/state/demo
                printf '%s uid=%s DEMO_MIXIN=%s\n' "$(date -u +%Y-%m-%dT%H:%M:%S.%NZ)" "$(id -u)" "${DEMO_MIXIN:-<unset>}" > /home/agent/.local/state/demo/mixin-install-agent
              description: Agent install marker; declares no env, so DEMO_MIXIN must read <unset>
              user: agent
        startup:
            - command: |
                mkdir -p /home/agent/.local/state/demo
                printf '%s uid=%s\n' "$(date -u +%Y-%m-%dT%H:%M:%S.%NZ)" "$(id -u)" >> /home/agent/.local/state/demo/mixin-startup
              description: Foreground startup hook, one line per boot
            - background: true
              command: while :; do touch /tmp/demo-mixin-heartbeat; sleep 10; done
              description: Heartbeat every 10 seconds
    - type: com.docker.sandbox/agent-context@1
      config:
        content: |
            The demo-mixin kit is applied. Run `demo-mixin` or `demo-mixin-hello`
            for a greeting. DEMO_MIXIN=1 is set. Install markers live in
            /var/lib/demo and ~/.local/state/demo.