HUB
Sign inSign up

sbx/droid-sessions:latest

Multi-platform
Manifest digest

sha256:b83ab4ea242bcd4c56dc6ef02b5016e8440e11bf5b8645748f8b927baea6e0fb

Last pushed

13 days by dhibot

Type

Sandbox Kit

Manifest digest

sha256:b83ab4ea242bcd4c56dc6ef02b5016e8440e11bf5b8645748f8b927baea6e0fb

yaml
schemaVersion: "3"
displayName: Factory Droid sessions
author: Docker, Inc. https://docker.com
description: Factory Droid host-shared session history
sourceUrl: https://github.com/docker-hardened-images/definitions
version: 1.0.0
licenses:
    - Apache-2.0
kind: mixin
requires:
    - droid
capabilities:
    - type: com.docker.sandbox/host-mount@1
      config:
        mode: "0700"
        path: /home/agent/droid-history
    - type: com.docker.sandbox/lifecycle@1
      config:
        install:
            - command: |
                set -eu
                case "${SANDBOX_NAME:-}" in
                  "" | . | .. | */*) echo 'SANDBOX_NAME must be one path segment' >&2; exit 1 ;;
                esac
                state="/home/agent/.factory"
                history="/home/agent/droid-history/$SANDBOX_NAME"
                mkdir -p "$state" "$history/sessions"
                link="$state/sessions"
                target="$history/sessions"
                if [ -L "$link" ]; then
                  [ "$(readlink "$link")" = "$target" ] || { echo "Refusing to replace unexpected symlink: $link" >&2; exit 1; }
                  exit 0
                fi
                if [ -e "$link" ]; then
                  rmdir "$link" || { echo "Cannot replace $link; move existing state to the host directory first." >&2; exit 1; }
                fi
                ln -s "$target" "$link"
              description: Link transcript storage to this sandbox’s host-shared directory
              env:
                - SANDBOX_NAME
              user: agent
args:
    version:
        required: true
        pattern: ^[0-9]+\.[0-9]+\.[0-9]+$
        buildArg: VERSION