Files
lxd-profiles/profiles/applications/app-ollama.profile.yaml
T
xavierandClaude Opus 5.5 f37c01df57 feat: Switch profiles to cgroup v2 and drop raw.lxc from docker profiles
- Use lxc.cgroup2.devices.allow instead of the cgroup v1 key, ignored on
  cgroup v2 hosts (Ubuntu >= 21.10)
- Remove raw.lxc (unconfined apparmor, all devices, no cap drop) from
  docker, dokploy and coolify: privileged + nesting is enough, tested
  with build, published ports, privileged containers, limits and restart
- Add docker-unprivileged profile (nesting + mknod/setxattr syscall
  interception) for new containers
- Sync microk8s with the deployed version (device numbering)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 00:27:16 +01:00

48 lines
1.6 KiB
YAML

---
name: app-ollama
description: LXD Profile to launch a private ollama instance
config:
linux.kernel_modules: overlay
raw.lxc: |-
lxc.apparmor.profile = unconfined
lxc.cgroup2.devices.allow = a
lxc.mount.auto=proc:rw sys:rw
lxc.cap.drop =
security.nesting: "true"
security.privileged: "true"
security.syscalls.intercept.mknod: "true"
security.syscalls.intercept.setxattr: "true"
user.vendor-data: |
#cloud-config
package_update: true
package_upgrade: true
packages:
- curl
- avahi-daemon
write_files:
- path: /etc/systemd/system/ollama.service.d/override.conf
content: |
[Service]
Environment=OLLAMA_HOST=0.0.0.0
runcmd:
# Install ollama
- curl https://ollama.ai/install.sh | sh
# Setup/fix systemd service unit file for ollama
- systemctl enable ollama.service
- systemctl start ollama.service
# Pull some models
- ollama pull tinyllama:chat
- ollama pull codellama:7b-instruct
- ollama pull codellama:7b-python
# Install docker
- curl https://get.docker.com | sh
# Install ollama-webui
- docker run --detach --add-host=host.docker.internal:host-gateway -p 3000:8080 -v ollama-webui:/app/backend/data --restart always --name ollama-webui ghcr.io/ollama-webui/ollama-webui:main
- docker run --detach --add-host=host.docker.internal:host-gateway -p 3001:3000 --restart always --name chatbot-ollama ghcr.io/ivanfioravanti/chatbot-ollama:main
locale: fr_FR.UTF-8
timezone: Europe/Paris