HUB
Sign inSign up

sbx/devin-sessions:1.0.0

Multi-platform
Manifest digest

sha256:3f4b786b479b15eb73d4ecefff44222172fa26a9a7ef84b457cd6ff426753e06

Last pushed

8 days by dhibot

Type

Sandbox Kit

Manifest digest

sha256:3f4b786b479b15eb73d4ecefff44222172fa26a9a7ef84b457cd6ff426753e06

yaml
schemaVersion: "3"
displayName: Devin host sessions
author: Docker, Inc. https://docker.com
description: Devin host sessions
sourceUrl: https://github.com/docker-hardened-images/definitions
version: 1.0.0
licenses:
    - Apache-2.0
kind: mixin
requires:
    - devin
capabilities:
    - type: com.docker.sandbox/host-mount@1
      config:
        mode: "0700"
        path: /home/agent/devin-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/.local/share/devin/cli
                history="/home/agent/devin-history/$SANDBOX_NAME"
                mkdir -p "$state" "$history"
                for name in sessions.db sessions.db-wal sessions.db-shm; do
                  link="$state/$name"
                  target="$history/$name"
                  if [ -L "$link" ]; then
                    [ "$(readlink "$link")" = "$target" ] || { echo "Refusing unexpected symlink: $link" >&2; exit 1; }
                    continue
                  fi
                  [ ! -e "$link" ] || { echo "Cannot replace existing state: $link" >&2; exit 1; }
                  ln -s "$target" "$link"
                done
              description: Link the session database into this sandbox's host directory
              env:
                - SANDBOX_NAME
              user: agent
args:
    version:
        required: true
        pattern: ^[0-9]+\.[0-9]+\.[0-9]+$
        buildArg: VERSION