Skip to content

Instantly share code, notes, and snippets.

@No9
Last active May 11, 2025 00:18
Show Gist options
  • Save No9/fb241ce3e2740d2ad5008770c2aa4617 to your computer and use it in GitHub Desktop.
Save No9/fb241ce3e2740d2ad5008770c2aa4617 to your computer and use it in GitHub Desktop.
[Unit]
Description=shellhub agent container
After=network-online.target    
       
[Container]
ContainerName=shellhub-agent
Environment=SHELLHUB_TENANT_ID=<TENENT-ID> SHELLHUB_SERVER_ADDRESS=https://cloud.shellhub.io SHELLHUB_PRIVATE_KEY=/host/etc/shellhub.key
EnvironmentFile=/etc/shellhub.env
Image=docker.io/shellhubio/agent:v0.18.2
PodmanArgs=--pid host --privileged
SecurityLabelDisable=true
Volume=/:/host
Volume=/dev:/dev
Volume=/var/run/podman/podman.sock:/var/run/docker.sock
Volume=/etc/passwd:/etc/passwd
Volume=/etc/group:/etc/group
Volume=/proc:/proc
Volume=/var/run:/var/run
Volume=/var/log:/var/log
Volume=/tmp:/tmp

[Service]
Restart=always
TimeoutStopSec=120

ExecStartPre=/bin/sh -c '/usr/bin/echo "SHELLHUB_PREFERRED_HOSTNAME="$(/usr/bin/cat /etc/machine-id) > /etc/shellhub.env 2>&1'
[Install]
WantedBy=multi-user.target default.target 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment