Sign inSign up

longnguyen58445/offload-engine-kit:0.1.0

Multi-platform
Manifest digest

sha256:92b4eb28346fcac7dc06147bb06db9fa32ea6cd6be0669195fa49a7974ef3eed

Last pushed

3 days by longnguyen58445

Type

Sandbox Kit

Manifest digest

sha256:92b4eb28346fcac7dc06147bb06db9fa32ea6cd6be0669195fa49a7974ef3eed

yaml
schemaVersion: "3"
displayName: Offload engine
author: Docker, Inc.
description: 'Docker Offload''s engine add-ons for any sandbox that already runs Docker Engine: mutagen agents and their sync root, cloud-interceptor, the secretsrunc runtime, hubproxy, and the cloud.docker.run.* daemon labels.'
sourceUrl: https://github.com/docker/tcc-vm-images
version: 0.1.0
kind: mixin
provides:
    - [email protected]
requires:
    - deb/docker-ce
capabilities:
    - type: com.docker.sandbox/dockerd@1
      optional: true
      description: The workload's Docker Engine, which Offload's clients drive
    - type: com.docker.sandbox/network-policy@1
      config:
        runtime:
            allow:
                - auth.docker.io
                - registry-1.docker.io
                - production.cloudflare.docker.com
                - docker-images-prod.6aa30f8b08e16409b46e0173d6de2f56.r2.cloudflarestorage.com
    - type: com.docker.sandbox/lifecycle@1
      config:
        startup:
            - command:
                - sh
                - -c
                - |
                  grep -q '[[:space:]]hubproxy\.docker\.internal' /etc/hosts \
                    || echo '127.0.0.1 hubproxy.docker.internal' >> /etc/hosts
              description: Resolve hubproxy.docker.internal to the in-sandbox hubproxy
              user: "0"
            - background: true
              command:
                - sh
                - -c
                - |
                  mkdir -p /var/log/offload-engine
                  log=/var/log/offload-engine/registryaccess.log
                  while :; do
                    /usr/local/bin/registryaccess --config=/etc/ram/access.json \
                      --addr=127.0.0.1:2378 --hubproxy-addr=127.0.0.1:5555 >>"$log" 2>&1
                    echo "registryaccess exited (rc=$?) - restarting in 2s" >>"$log"
                    sleep 2
                  done
              description: Run hubproxy on 127.0.0.1:5555
              env:
                - HTTP_PROXY
                - HTTPS_PROXY
                - NO_PROXY
              user: "0"
            - command:
                - sh
                - -c
                - |
                  set -eu
                  i=0
                  until curl -fsS --unix-socket /var/run/docker.sock http://localhost/_ping >/dev/null 2>&1; do
                    i=$((i + 1))
                    if [ "$i" -ge 120 ]; then
                      echo "offload-engine: dockerd did not answer /_ping on /var/run/docker.sock within 120s" >&2
                      exit 1
                    fi
                    sleep 1
                  done
                  mkdir -p /var/lib/docker/mutagen
                  chmod o+x /var/lib/docker
                  chmod 1777 /var/lib/docker/mutagen
              description: Prepare /var/lib/docker/mutagen for bind-mount sync
              user: "0"
args:
    BUILD_IMAGE:
        required: true
        description: Debian build stage that fetches and verifies the mutagen agents
        pattern: ^[^@\s]+@sha256:[0-9a-f]{64}$
        buildArg: BUILD_IMAGE
    REGISTRYACCESS_IMAGE:
        required: true
        description: docker/offload-registryaccess, source of the three registry-stack binaries
        pattern: ^[^@\s]+@sha256:[0-9a-f]{64}$
        buildArg: REGISTRYACCESS_IMAGE
    version:
        default: 0.1.0
        description: Release of this kit, stamped into cloud.docker.run.version
        pattern: ^[0-9]+\.[0-9]+\.[0-9]+$
        buildArg: OFFLOAD_ENGINE_VERSION