mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-11 03:37:09 +02:00
- Introduced ContainerRuntime field in AgentConfig and AgentEnvConfig. - Added IterAgents and NumAgents functions for agent pool management. - Updated agent creation and verification endpoints to handle container runtime. - Enhanced Docker Compose template to support different container runtimes. - Added runtime endpoint to retrieve agent runtime information.
67 lines
1.9 KiB
Cheetah
67 lines
1.9 KiB
Cheetah
services:
|
|
agent:
|
|
image: "{{.Image}}"
|
|
container_name: godoxy-agent
|
|
restart: always
|
|
{{ if eq .ContainerRuntime "podman" -}}
|
|
ports:
|
|
- "{{.Port}}:{{.Port}}"
|
|
{{ else -}}
|
|
network_mode: host # do not change this
|
|
{{ end -}}
|
|
environment:
|
|
{{ if eq .ContainerRuntime "nerdctl" -}}
|
|
DOCKER_SOCKET: "/var/run/containerd/containerd.sock"
|
|
RUNTIME: "nerdctl"
|
|
{{ else if eq .ContainerRuntime "podman" -}}
|
|
DOCKER_SOCKET: "/var/run/podman/podman.sock"
|
|
RUNTIME: "podman"
|
|
{{ else -}}
|
|
DOCKER_SOCKET: "/var/run/docker.sock"
|
|
RUNTIME: "docker"
|
|
{{ end -}}
|
|
AGENT_NAME: "{{.Name}}"
|
|
AGENT_PORT: "{{.Port}}"
|
|
AGENT_CA_CERT: "{{.CACert}}"
|
|
AGENT_SSL_CERT: "{{.SSLCert}}"
|
|
# use agent as a docker socket proxy: [host]:port
|
|
# set LISTEN_ADDR to enable (e.g. 127.0.0.1:2375)
|
|
LISTEN_ADDR:
|
|
POST: false
|
|
ALLOW_RESTARTS: false
|
|
ALLOW_START: false
|
|
ALLOW_STOP: false
|
|
AUTH: false
|
|
BUILD: false
|
|
COMMIT: false
|
|
CONFIGS: false
|
|
CONTAINERS: false
|
|
DISTRIBUTION: false
|
|
EVENTS: true
|
|
EXEC: false
|
|
GRPC: false
|
|
IMAGES: false
|
|
INFO: false
|
|
NETWORKS: false
|
|
NODES: false
|
|
PING: true
|
|
PLUGINS: false
|
|
SECRETS: false
|
|
SERVICES: false
|
|
SESSION: false
|
|
SWARM: false
|
|
SYSTEM: false
|
|
TASKS: false
|
|
VERSION: true
|
|
VOLUMES: false
|
|
volumes:
|
|
{{ if eq .ContainerRuntime "podman" -}}
|
|
- /var/run/podman/podman.sock:/var/run/podman/podman.sock
|
|
{{ else if eq .ContainerRuntime "nerdctl" -}}
|
|
- /var/run/containerd/containerd.sock:/var/run/containerd/containerd.sock
|
|
- /var/lib/nerdctl:/var/lib/nerdctl:ro # required to read metadata like network info
|
|
{{ else -}}
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
{{ end -}}
|
|
- ./data:/app/data
|