[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F0ZVW39G43VKEY7HNK7KEY":3,"skill-same:01M6F0ZVW39G43VKEY7HNK7KEY":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6F0ZVW39G43VKEY7HNK7KEY","routeros-container",null,"RouterOS \u002Fcontainer subsystem for running OCI containers on MikroTik devices. Use when: enabling containers on RouterOS, setting up VETH\u002Fbridge networking for containers, managing container lifecycle via CLI or REST API, building OCI images for RouterOS, configuring container environment variables, troubleshooting container issues, or when the user mentions RouterOS container, \u002Fcontainer, VETH, device-mode container, or MikroTik Docker.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Ftikoci\u002Frouteros-container\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"routeros container","container","bridge","Variables","via","environment variables","images","up","use","environment","cli","api","lifecycle","devices","REST","issues","networking","oci","docker","containers","2026-11-10 10:12:30",false,"---\nname: routeros-container\ndescription: \"RouterOS \u002Fcontainer subsystem for running OCI containers on MikroTik devices. Use when: enabling containers on RouterOS, setting up VETH\u002Fbridge networking for containers, managing container lifecycle via CLI or REST API, building OCI images for RouterOS, configuring container environment variables, troubleshooting container issues, or when the user mentions RouterOS container, \u002Fcontainer, VETH, device-mode container, or MikroTik Docker.\"\n---\n\n# RouterOS Container Subsystem\n\n## Overview\n\nRouterOS 7.x includes a container subsystem (`\u002Fcontainer`) that runs OCI-compatible container images directly on MikroTik hardware. It is NOT Docker — it's MikroTik's own implementation with significant differences.\n\n**Requirements:**\n- RouterOS 7.x with `container` extra package installed\n- Device-mode must be enabled (requires physical access for initial setup)\n- Sufficient storage (external USB disk recommended, 100+ MB\u002Fs, 10K+ random IOPS)\n- ARM, ARM64, or x86 architecture (MIPS not supported for containers)\n\n## Device-Mode — Physical Access Required\n\nContainer support is gated behind device-mode, which requires physical confirmation (reset button press or power cycle) to enable:\n\n```routeros\n# Enable container mode\n\u002Fsystem\u002Fdevice-mode\u002Fupdate mode=advanced container=yes\n\n# After executing: physically confirm within activation-timeout\n# - Press reset button, OR\n# - Power cycle the device\n```\n\nDevice-mode is a general RouterOS security feature — not container-specific. It gates many features (scheduler, fetch, sniffer, etc.) across four modes (`home`, `basic`, `advanced`, `rose`) with device-dependent factory defaults.\n\nFor the full feature matrix, modes, update properties, and physical confirmation details: see the [Device-mode reference](..\u002Frouteros-fundamentals\u002Freferences\u002Fdevice-mode.md) in the `routeros-fundamentals` skill.\n\n**Mode script bypass (7.22+):** During netinstall, a mode script (`-sm`) can set device-mode on first boot, automatically triggering a reboot. See the `routeros-netinstall` skill.\n\n## Installing the Container Package\n\n```routeros\n# Check if container package is already installed\n\u002Fsystem\u002Fpackage\u002Fprint where name=container\n```\n\n**Method 1: Upload .npk file + reboot** (offline)\n```sh\n# Upload via SCP (or Winbox drag-and-drop, or WebFig file upload)\nscp container-7.22-arm64.npk admin@router:\u002F\n```\n```routeros\n# Then reboot to activate\n\u002Fsystem\u002Freboot\n```\n\n**Method 2: Online package update** (requires internet)\n```routeros\n\u002Fsystem\u002Fpackage\u002Fupdate check-for-updates\n\u002Fsystem\u002Fpackage\u002Fupdate install\n```\nThis downloads and installs all available updates including extra packages. To enable a specific package already uploaded but not active, use `\u002Fsystem\u002Fpackage\u002Fenable container` then `\u002Fsystem\u002Freboot`.\n\n## Networking Setup\n\n### VETH (Virtual Ethernet)\n\nContainers connect to RouterOS networking via VETH interfaces:\n\n```routeros\n# Create VETH pair\n\u002Finterface\u002Fveth\u002Fadd name=veth-myapp address=172.17.0.2\u002F24 gateway=172.17.0.1\n\n# The VETH name IS the container's interface name (RouterOS 7.21+)\n```\n\n### Bridge Setup\n\n```routeros\n# Create a bridge for containers\n\u002Finterface\u002Fbridge\u002Fadd name=containers\n\n# Add VETH to the bridge\n\u002Finterface\u002Fbridge\u002Fport\u002Fadd bridge=containers interface=veth-myapp\n\n# Assign IP to bridge (acts as gateway for containers)\n\u002Fip\u002Faddress\u002Fadd address=172.17.0.1\u002F24 interface=containers\n```\n\n### NAT \u002F Firewall\n\n```routeros\n# Masquerade container traffic for internet access\n\u002Fip\u002Ffirewall\u002Fnat\u002Fadd chain=srcnat action=masquerade src-address=172.17.0.0\u002F24\n\n# Port forwarding from host to container\n\u002Fip\u002Ffirewall\u002Fnat\u002Fadd chain=dstnat action=dst-nat \\\n  dst-port=8080 protocol=tcp to-addresses=172.17.0.2 to-ports=80\n\n# Allow container bridge in interface list (if firewall restricts)\n\u002Finterface\u002Flist\u002Fmember\u002Fadd list=LAN interface=containers\n```\n\n### Layer 2 Networking (Bridge Mode)\n\nFor containers that need to be on the same L2 network as physical interfaces (e.g., netinstall):\n\n```routeros\n# Add both physical port and VETH to the same bridge\n\u002Finterface\u002Fbridge\u002Fport\u002Fadd bridge=mybridge interface=ether5\n\u002Finterface\u002Fbridge\u002Fport\u002Fadd bridge=mybridge interface=veth-netinstall\n```\n\nThis gives the container direct L2 access to devices on ether5.\n\n## Environment Variables and Mounts\n\nThere are two ways to attach env vars and mounts to a container (from 7.21+):\n\n### Inline (preferred for 7.21+)\n\nSet `env=` and `mount=` directly on `\u002Fcontainer\u002Fadd` — keeps the container self-contained:\n\n```routeros\n# Inline env vars and mount (7.21+)\n\u002Fcontainer\u002Fadd remote-image=pihole\u002Fpihole:latest interface=veth1 \\\n  env=\"TZ=Europe\u002FRiga,WEBPASSWORD=secret\" \\\n  mount=\"src=disk1\u002Fpihole,dst=\u002Fetc\u002Fpihole\" \\\n  root-dir=disk1\u002Fimages\u002Fpihole logging=yes\n```\n\nThis is also how `\u002Fapp` YAML works under the hood — inline is the modern pattern and easier for automation (no separate linked objects to manage).\n\n### Named Lists (works across all versions)\n\nCreate env vars and mounts as separate objects, then reference by name:\n\n```routeros\n# Create named env list (7.20+ uses 'list=', pre-7.20 used 'name=')\n\u002Fcontainer\u002Fenvs\u002Fadd list=MYAPP key=TZ value=\"Europe\u002FRiga\"\n\u002Fcontainer\u002Fenvs\u002Fadd list=MYAPP key=WEBPASSWORD value=\"secret\"\n\n# Create named mount\n\u002Fcontainer\u002Fmounts\u002Fadd name=appdata src=disk1\u002Fappdata dst=\u002Fdata\n\n# Reference from container (7.20+ uses 'envlists=', pre-7.20 used 'envlist=')\n\u002Fcontainer\u002Fadd file=myimage.tar interface=veth1 \\\n  envlists=MYAPP mountlists=appdata root-dir=disk1\u002Fmyapp\n```\n\n**Best practice:** Always place container volumes on external disk (`disk1\u002F`), never on internal flash storage.\n\n### Property Name History\n\nThe naming of env\u002Fmount reference properties changed at version boundaries:\n\n| Version | Env list grouping (`\u002Fcontainer\u002Fenvs\u002Fadd`) | Container env reference (`\u002Fcontainer\u002Fadd`) | Container mount reference |\n|---|---|---|---|\n| Pre-7.20 | `key=`, `value=` only (no grouping property) | *(no env reference property)* | *(not available)* |\n| 7.20 | `list=` added | `envlists=` (plural) added | *(not available)* |\n| 7.21+ | `list=` | `envlists=` + inline `env=` | `mountlists=` + inline `mount=` |\n\n> **Version note:** Property names for 7.20+ are confirmed against `\u002Fconsole\u002Finspect` command tree data. Pre-7.20, `\u002Fcontainer\u002Fenvs\u002Fadd` had only `key` and `value` with no grouping mechanism; `\u002Fcontainer\u002Fadd` had no env reference property. Inline `env=` and `mount=` were added at 7.21.\n\n## Container Image Formats\n\nRouterOS accepts container images in these formats:\n\n### Option A: Pull from Registry\n```routeros\n\u002Fcontainer\u002Fconfig\u002Fset registry-url=https:\u002F\u002Fregistry-1.docker.io tmpdir=disk1\u002Fpull\n\u002Fcontainer\u002Fadd remote-image=library\u002Falpine:latest interface=veth-myapp\n```\n\n### Option B: Import Local Tar File\nUpload a Docker v1 tar to the router, then:\n```routeros\n\u002Fcontainer\u002Fadd file=myimage.tar interface=veth-myapp\n```\n\n### OCI Image Requirements for Local Import\n\nRouterOS's container loader has specific requirements for local tar files:\n\n1. **Single layer only** — multi-layer images are not supported\n2. **No gzip compression** — layers must be uncompressed tar\n3. **Docker v1 manifest format** — `manifest.json` + `config.json` + `layer.tar`\n\n```\nmyimage.tar\n├── manifest.json    # [{\"Config\":\"config.json\",\"RepoTags\":[\"name:tag\"],\"Layers\":[\"layer.tar\"]}]\n├── config.json      # {\"architecture\":\"arm64\",\"os\":\"linux\",\"config\":{...},\"rootfs\":{...}}\n└── layer.tar        # Uncompressed tar of the full filesystem\n```\n\nSee the `tikoci-oci-image-building` skill for building compliant images without Docker.\n\n## Container Lifecycle\n\n### CLI\n\n```routeros\n# Create container (7.21+ inline syntax)\n\u002Fcontainer\u002Fadd file=myimage.tar interface=veth-myapp \\\n  env=\"MY_VAR=hello\" mount=\"src=disk1\u002Fappdata,dst=\u002Fdata\" \\\n  root-dir=disk1\u002Fmyapp logging=yes\n\n# Start\n\u002Fcontainer\u002Fstart [find tag~\"myapp\"]\n\n# Stop\n\u002Fcontainer\u002Fstop [find tag~\"myapp\"]\n\n# View status\n\u002Fcontainer\u002Fprint\n\n# View logs (if logging=yes)\n\u002Flog\u002Fprint where topics~\"container\"\n\n# Remove (must be fully stopped first)\n\u002Fcontainer\u002Fremove [find tag~\"myapp\"]\n```\n\n### REST API\n\n```typescript\nconst base = \"http:\u002F\u002F192.168.1.1\u002Frest\";\nconst auth = { headers: { Authorization: `Basic ${btoa(\"admin:\")}` } };\n\n\u002F\u002F List containers\nconst containers = await fetch(`${base}\u002Fcontainer`, auth).then(r => r.json());\n\n\u002F\u002F Start container by ID\nawait fetch(`${base}\u002Fcontainer\u002Fstart`, {\n  method: \"POST\", ...auth,\n  headers: { ...auth.headers, \"Content-Type\": \"application\u002Fjson\" },\n  body: JSON.stringify({ \".id\": \"*1\" }),\n});\n\n\u002F\u002F Check status — .running field is \"true\"\u002F\"false\" (strings!)\nconst status = await fetch(`${base}\u002Fcontainer\u002F*1`, auth).then(r => r.json());\nif (status.running === \"true\") { \u002F* container is running *\u002F }\n\n\u002F\u002F Stop container\nawait fetch(`${base}\u002Fcontainer\u002Fstop`, {\n  method: \"POST\", ...auth,\n  body: JSON.stringify({ \".id\": \"*1\" }),\n});\n\n\u002F\u002F Delete — must be fully stopped. Poll .running and retry.\nasync function deleteContainer(id) {\n  for (let i = 0; i \u003C 5; i++) {\n    const c = await fetch(`${base}\u002Fcontainer\u002F${id}`, auth).then(r => r.json());\n    if (c.running === \"false\") {\n      await fetch(`${base}\u002Fcontainer\u002F${id}`, { method: \"DELETE\", ...auth });\n      return;\n    }\n    await new Promise(r => setTimeout(r, 3000));\n  }\n  throw new Error(\"Container did not stop in time\");\n}\n```\n\n### REST API Gotchas for Containers\n\n- **`.running` field** is the status indicator — values are strings `\"true\"` \u002F `\"false\"`, not booleans\n- **No `.stopped` field exists** — only check `.running`\n- **Delete while stopping = HTTP 400** — must poll `.running` until `\"false\"` before DELETE\n- **`file=` for local tar**, `remote-image=` for registry pull\n- **Container `envlists=`** (plural, 7.20+) references the env list name — note the plural. Pre-7.20 used `envlist=` (singular). See env\u002Fmount version history above.\n\n## Container Properties (from 7.22)\n\nSelected properties from `\u002Fcontainer\u002Fadd`. This is **not exhaustive** — use `rosetta` MCP tools (`routeros_command_tree` at `\u002Fcontainer\u002Fadd`) for the full list on a specific version.\n\n| Property | Description |\n|---|---|\n| `interface` | VETH interface |\n| `env` | Inline environment variables (7.21+). Comma-separated `KEY=value` pairs |\n| `envlists` | Named env list reference (7.20+). See env\u002Fmount section above |\n| `mount` | Inline volume mount (7.21+). `src=host\u002Fpath,dst=\u002Fcontainer\u002Fpath` |\n| `mountlists` | Named mount list reference (7.21+). See env\u002Fmount section above |\n| `root-dir` | Storage location for container filesystem |\n| `file` | Container tar file (local import) |\n| `remote-image` | Container image name (registry pull) |\n| `cmd` | Override container CMD |\n| `entrypoint` | Override container ENTRYPOINT |\n| `hostname` | Container hostname |\n| `dns` | DNS server for container |\n| `logging` | Enable container stdout\u002Fstderr to RouterOS log (`yes`\u002F`no`) |\n| `start-on-boot` | Auto-start container on device boot (`yes`\u002F`no`) |\n| `workdir` | Override working directory |\n| `name` | Container name (for `[find where name=...]`) |\n| `devices` | Pass through physical devices (7.20+) |\n| `cpu-list` | CPU core affinity |\n| `memory-high` | RAM usage limit in bytes |\n\n## Architecture Mapping\n\nWhen pulling from registries or building images, map RouterOS architecture to Docker platform:\n\n| RouterOS `architecture-name` | Docker Platform |\n|---|---|\n| `arm` | `linux\u002Farm\u002Fv7` |\n| `arm64` | `linux\u002Farm64` |\n| `x86` | `linux\u002Famd64` |\n\nQuery the router's architecture:\n```typescript\nconst resource = await fetch(`${base}\u002Fsystem\u002Fresource`, auth).then(r => r.json());\nconst arch = resource[\"architecture-name\"]; \u002F\u002F \"arm64\", \"arm\", \"x86\"\n```\n\n## \u002Fapp System (7.21+\u002F7.22+)\n\nRouterOS 7.21 introduced the `\u002Fapp` path (built-in app listing). Full YAML app creation (`\u002Fapp\u002Fadd`) was added in 7.22. See the `routeros-app-yaml` skill for the full YAML specification.\n\n```routeros\n# List available apps\n\u002Fapp\u002Fprint\n\n# Add app from URL\n\u002Fapp\u002Fadd yaml-url=https:\u002F\u002Fexample.com\u002Fmyapp.tikapp.yaml\n```\n\n### \u002Fapp vs Manual Container Setup\n\n| Concern | Manual (this page) | \u002Fapp YAML |\n|---|---|---|\n| Networking | Full control — any bridge\u002FVETH\u002FL2 topology | Docker-style: `internal` subnet with port forwarding (NAT) |\n| L2 bridge access | Yes — add VETH + physical port to same bridge | Not directly — but can assign a bridge post-creation via `\u002Fapp\u002Fset network=\u003Cbridge>` |\n| Multi-container | Manual per-container setup | Declarative YAML, multiple services |\n| Use case | Raw L2 access (netinstall, DHCP relay, etc.) | Standard app deployment with port forwarding |\n\nNetinstall specifically requires L2 bridge access for BOOTP\u002FTFTP, which is why the manual VETH+bridge approach is used rather than \u002Fapp. For typical containers that only need port-forwarded TCP\u002FUDP services, `\u002Fapp` is simpler.\n\n## Additional Resources\n\n**Related skills:**\n- For netinstall and device-mode automation: see the `routeros-netinstall` skill\n- For building OCI images compatible with RouterOS: see the `tikoci-oci-image-building` skill\n- For the \u002Fapp YAML format: see the `routeros-app-yaml` skill\n- For general RouterOS fundamentals (CLI, REST, scripting): see the `routeros-fundamentals` skill\n\n**MCP tools:**\n- For RouterOS documentation and property lookups: use the `rosetta` MCP server tools (`routeros_search`, `routeros_get_page`, `routeros_search_properties`)\n\n**External docs:**\n- MikroTik official docs: https:\u002F\u002Fhelp.mikrotik.com\u002Fdocs\u002Fspaces\u002FROS\u002Fpages\u002F84901929\u002FContainer\n","# RouterOS Container Subsystem\n\n## Overview\n\nRouterOS 7.x includes a container subsystem (`\u002Fcontainer`) that runs OCI-compatible container images directly on MikroTik hardware. It is NOT Docker — it's MikroTik's own implementation with significant differences.\n\n**Requirements:**\n- RouterOS 7.x with `container` extra package installed\n- Device-mode must be enabled (requires physical access for initial setup)\n- Sufficient storage (external USB disk recommended, 100+ MB\u002Fs, 10K+ random IOPS)\n- ARM, ARM64, or x86 architecture (MIPS not supported for containers)\n\n## Device-Mode — Physical Access Required\n\nContainer support is gated behind device-mode, which requires physical confirmation (reset button press or power cycle) to enable:\n\n```routeros\n# Enable container mode\n\u002Fsystem\u002Fdevice-mode\u002Fupdate mode=advanced container=yes\n\n# After executing: physically confirm within activation-timeout\n# - Press reset button, OR\n# - Power cycle the device\n```\n\nDevice-mode is a general RouterOS security feature — not container-specific. It gates many features (scheduler, fetch, sniffer, etc.) across four modes (`home`, `basic`, `advanced`, `rose`) with device-dependent factory defaults.\n\nFor the full feature matrix, modes, update properties, and physical confirmation details: see the [Device-mode reference](..\u002Frouteros-fundamentals\u002Freferences\u002Fdevice-mode.md) in the `routeros-fundamentals` skill.\n\n**Mode script bypass (7.22+):** During netinstall, a mode script (`-sm`) can set device-mode on first boot, automatically triggering a reboot. See the `routeros-netinstall` skill.\n\n## Installing the Container Package\n\n```routeros\n# Check if container package is already installed\n\u002Fsystem\u002Fpackage\u002Fprint where name=container\n```\n\n**Method 1: Upload .npk file + reboot** (offline)\n```sh\n# Upload via SCP (or Winbox drag-and-drop, or WebFig file upload)\nscp container-7.22-arm64.npk admin@router:\u002F\n```\n```routeros\n# Then reboot to activate\n\u002Fsystem\u002Freboot\n```\n\n**Method 2: Online package update** (requires internet)\n```routeros\n\u002Fsystem\u002Fpackage\u002Fupdate check-for-updates\n\u002Fsystem\u002Fpackage\u002Fupdate install\n```\nThis downloads and installs all available updates including extra packages. To enable a specific package already uploaded but not active, use `\u002Fsystem\u002Fpackage\u002Fenable container` then `\u002Fsystem\u002Freboot`.\n\n## Networking Setup\n\n### VETH (Virtual Ethernet)\n\nContainers connect to RouterOS networking via VETH interfaces:\n\n```routeros\n# Create VETH pair\n\u002Finterface\u002Fveth\u002Fadd name=veth-myapp address=172.17.0.2\u002F24 gateway=172.17.0.1\n\n# The VETH name IS the container's interface name (RouterOS 7.21+)\n```\n\n### Bridge Setup\n\n```routeros\n# Create a bridge for containers\n\u002Finterface\u002Fbridge\u002Fadd name=containers\n\n# Add VETH to the bridge\n\u002Finterface\u002Fbridge\u002Fport\u002Fadd bridge=containers interface=veth-myapp\n\n# Assign IP to bridge (acts as gateway for containers)\n\u002Fip\u002Faddress\u002Fadd address=172.17.0.1\u002F24 interface=containers\n```\n\n### NAT \u002F Firewall\n\n```routeros\n# Masquerade container traffic for internet access\n\u002Fip\u002Ffirewall\u002Fnat\u002Fadd chain=srcnat action=masquerade src-address=172.17.0.0\u002F24\n\n# Port forwarding from host to container\n\u002Fip\u002Ffirewall\u002Fnat\u002Fadd chain=dstnat action=dst-nat \\\n  dst-port=8080 protocol=tcp to-addresses=172.17.0.2 to-ports=80\n\n# Allow container bridge in interface list (if firewall restricts)\n\u002Finterface\u002Flist\u002Fmember\u002Fadd list=LAN interface=containers\n```\n\n### Layer 2 Networking (Bridge Mode)\n\nFor containers that need to be on the same L2 network as physical interfaces (e.g., netinstall):\n\n```routeros\n# Add both physical port and VETH to the same bridge\n\u002Finterface\u002Fbridge\u002Fport\u002Fadd bridge=mybridge interface=ether5\n\u002Finterface\u002Fbridge\u002Fport\u002Fadd bridge=mybridge interface=veth-netinstall\n```\n\nThis gives the container direct L2 access to devices on ether5.\n\n## Environment Variables and Mounts\n\nThere are two ways to attach env vars and mounts to a container (from 7.21+):\n\n### Inline (preferred for 7.21+)\n\nSet `env=` and `mount=` directly on `\u002Fcontainer\u002Fadd` — keeps the container self-contained:\n\n```routeros\n# Inline env vars and mount (7.21+)\n\u002Fcontainer\u002Fadd remote-image=pihole\u002Fpihole:latest interface=veth1 \\\n  env=\"TZ=Europe\u002FRiga,WEBPASSWORD=secret\" \\\n  mount=\"src=disk1\u002Fpihole,dst=\u002Fetc\u002Fpihole\" \\\n  root-dir=disk1\u002Fimages\u002Fpihole logging=yes\n```\n\nThis is also how `\u002Fapp` YAML works under the hood — inline is the modern pattern and easier for automation (no separate linked objects to manage).\n\n### Named Lists (works across all versions)\n\nCreate env vars and mounts as separate objects, then reference by name:\n\n```routeros\n# Create named env list (7.20+ uses 'list=', pre-7.20 used 'name=')\n\u002Fcontainer\u002Fenvs\u002Fadd list=MYAPP key=TZ value=\"Europe\u002FRiga\"\n\u002Fcontainer\u002Fenvs\u002Fadd list=MYAPP key=WEBPASSWORD value=\"secret\"\n\n# Create named mount\n\u002Fcontainer\u002Fmounts\u002Fadd name=appdata src=disk1\u002Fappdata dst=\u002Fdata\n\n# Reference from container (7.20+ uses 'envlists=', pre-7.20 used 'envlist=')\n\u002Fcontainer\u002Fadd file=myimage.tar interface=veth1 \\\n  envlists=MYAPP mountlists=appdata root-dir=disk1\u002Fmyapp\n```\n\n**Best practice:** Always place container volumes on external disk (`disk1\u002F`), never on internal flash storage.\n\n### Property Name History\n\nThe naming of env\u002Fmount reference properties changed at version boundaries:\n\n| Version | Env list grouping (`\u002Fcontainer\u002Fenvs\u002Fadd`) | Container env reference (`\u002Fcontainer\u002Fadd`) | Container mount reference |\n|---|---|---|---|\n| Pre-7.20 | `key=`, `value=` only (no grouping property) | *(no env reference property)* | *(not available)* |\n| 7.20 | `list=` added | `envlists=` (plural) added | *(not available)* |\n| 7.21+ | `list=` | `envlists=` + inline `env=` | `mountlists=` + inline `mount=` |\n\n> **Version note:** Property names for 7.20+ are confirmed against `\u002Fconsole\u002Finspect` command tree data. Pre-7.20, `\u002Fcontainer\u002Fenvs\u002Fadd` had only `key` and `value` with no grouping mechanism; `\u002Fcontainer\u002Fadd` had no env reference property. Inline `env=` and `mount=` were added at 7.21.\n\n## Container Image Formats\n\nRouterOS accepts container images in these formats:\n\n### Option A: Pull from Registry\n```routeros\n\u002Fcontainer\u002Fconfig\u002Fset registry-url=https:\u002F\u002Fregistry-1.docker.io tmpdir=disk1\u002Fpull\n\u002Fcontainer\u002Fadd remote-image=library\u002Falpine:latest interface=veth-myapp\n```\n\n### Option B: Import Local Tar File\nUpload a Docker v1 tar to the router, then:\n```routeros\n\u002Fcontainer\u002Fadd file=myimage.tar interface=veth-myapp\n```\n\n### OCI Image Requirements for Local Import\n\nRouterOS's container loader has specific requirements for local tar files:\n\n1. **Single layer only** — multi-layer images are not supported\n2. **No gzip compression** — layers must be uncompressed tar\n3. **Docker v1 manifest format** — `manifest.json` + `config.json` + `layer.tar`\n\n```\nmyimage.tar\n├── manifest.json    # [{\"Config\":\"config.json\",\"RepoTags\":[\"name:tag\"],\"Layers\":[\"layer.tar\"]}]\n├── config.json      # {\"architecture\":\"arm64\",\"os\":\"linux\",\"config\":{...},\"rootfs\":{...}}\n└── layer.tar        # Uncompressed tar of the full filesystem\n```\n\nSee the `tikoci-oci-image-building` skill for building compliant images without Docker.\n\n## Container Lifecycle\n\n### CLI\n\n```routeros\n# Create container (7.21+ inline syntax)\n\u002Fcontainer\u002Fadd file=myimage.tar interface=veth-myapp \\\n  env=\"MY_VAR=hello\" mount=\"src=disk1\u002Fappdata,dst=\u002Fdata\" \\\n  root-dir=disk1\u002Fmyapp logging=yes\n\n# Start\n\u002Fcontainer\u002Fstart [find tag~\"myapp\"]\n\n# Stop\n\u002Fcontainer\u002Fstop [find tag~\"myapp\"]\n\n# View status\n\u002Fcontainer\u002Fprint\n\n# View logs (if logging=yes)\n\u002Flog\u002Fprint where topics~\"container\"\n\n# Remove (must be fully stopped first)\n\u002Fcontainer\u002Fremove [find tag~\"myapp\"]\n```\n\n### REST API\n\n```typescript\nconst base = \"http:\u002F\u002F192.168.1.1\u002Frest\";\nconst auth = { headers: { Authorization: `Basic ${btoa(\"admin:\")}` } };\n\n\u002F\u002F List containers\nconst containers = await fetch(`${base}\u002Fcontainer`, auth).then(r => r.json());\n\n\u002F\u002F Start container by ID\nawait fetch(`${base}\u002Fcontainer\u002Fstart`, {\n  method: \"POST\", ...auth,\n  headers: { ...auth.headers, \"Content-Type\": \"application\u002Fjson\" },\n  body: JSON.stringify({ \".id\": \"*1\" }),\n});\n\n\u002F\u002F Check status — .running field is \"true\"\u002F\"false\" (strings!)\nconst status = await fetch(`${base}\u002Fcontainer\u002F*1`, auth).then(r => r.json());\nif (status.running === \"true\") { \u002F* container is running *\u002F }\n\n\u002F\u002F Stop container\nawait fetch(`${base}\u002Fcontainer\u002Fstop`, {\n  method: \"POST\", ...auth,\n  body: JSON.stringify({ \".id\": \"*1\" }),\n});\n\n\u002F\u002F Delete — must be fully stopped. Poll .running and retry.\nasync function deleteContainer(id) {\n  for (let i = 0; i \u003C 5; i++) {\n    const c = await fetch(`${base}\u002Fcontainer\u002F${id}`, auth).then(r => r.json());\n    if (c.running === \"false\") {\n      await fetch(`${base}\u002Fcontainer\u002F${id}`, { method: \"DELETE\", ...auth });\n      return;\n    }\n    await new Promise(r => setTimeout(r, 3000));\n  }\n  throw new Error(\"Container did not stop in time\");\n}\n```\n\n### REST API Gotchas for Containers\n\n- **`.running` field** is the status indicator — values are strings `\"true\"` \u002F `\"false\"`, not booleans\n- **No `.stopped` field exists** — only check `.running`\n- **Delete while stopping = HTTP 400** — must poll `.running` until `\"false\"` before DELETE\n- **`file=` for local tar**, `remote-image=` for registry pull\n- **Container `envlists=`** (plural, 7.20+) references the env list name — note the plural. Pre-7.20 used `envlist=` (singular). See env\u002Fmount version history above.\n\n## Container Properties (from 7.22)\n\nSelected properties from `\u002Fcontainer\u002Fadd`. This is **not exhaustive** — use `rosetta` MCP tools (`routeros_command_tree` at `\u002Fcontainer\u002Fadd`) for the full list on a specific version.\n\n| Property | Description |\n|---|---|\n| `interface` | VETH interface |\n| `env` | Inline environment variables (7.21+). Comma-separated `KEY=value` pairs |\n| `envlists` | Named env list reference (7.20+). See env\u002Fmount section above |\n| `mount` | Inline volume mount (7.21+). `src=host\u002Fpath,dst=\u002Fcontainer\u002Fpath` |\n| `mountlists` | Named mount list reference (7.21+). See env\u002Fmount section above |\n| `root-dir` | Storage location for container filesystem |\n| `file` | Container tar file (local import) |\n| `remote-image` | Container image name (registry pull) |\n| `cmd` | Override container CMD |\n| `entrypoint` | Override container ENTRYPOINT |\n| `hostname` | Container hostname |\n| `dns` | DNS server for container |\n| `logging` | Enable container stdout\u002Fstderr to RouterOS log (`yes`\u002F`no`) |\n| `start-on-boot` | Auto-start container on device boot (`yes`\u002F`no`) |\n| `workdir` | Override working directory |\n| `name` | Container name (for `[find where name=...]`) |\n| `devices` | Pass through physical devices (7.20+) |\n| `cpu-list` | CPU core affinity |\n| `memory-high` | RAM usage limit in bytes |\n\n## Architecture Mapping\n\nWhen pulling from registries or building images, map RouterOS architecture to Docker platform:\n\n| RouterOS `architecture-name` | Docker Platform |\n|---|---|\n| `arm` | `linux\u002Farm\u002Fv7` |\n| `arm64` | `linux\u002Farm64` |\n| `x86` | `linux\u002Famd64` |\n\nQuery the router's architecture:\n```typescript\nconst resource = await fetch(`${base}\u002Fsystem\u002Fresource`, auth).then(r => r.json());\nconst arch = resource[\"architecture-name\"]; \u002F\u002F \"arm64\", \"arm\", \"x86\"\n```\n\n## \u002Fapp System (7.21+\u002F7.22+)\n\nRouterOS 7.21 introduced the `\u002Fapp` path (built-in app listing). Full YAML app creation (`\u002Fapp\u002Fadd`) was added in 7.22. See the `routeros-app-yaml` skill for the full YAML specification.\n\n```routeros\n# List available apps\n\u002Fapp\u002Fprint\n\n# Add app from URL\n\u002Fapp\u002Fadd yaml-url=https:\u002F\u002Fexample.com\u002Fmyapp.tikapp.yaml\n```\n\n### \u002Fapp vs Manual Container Setup\n\n| Concern | Manual (this page) | \u002Fapp YAML |\n|---|---|---|\n| Networking | Full control — any bridge\u002FVETH\u002FL2 topology | Docker-style: `internal` subnet with port forwarding (NAT) |\n| L2 bridge access | Yes — add VETH + physical port to same bridge | Not directly — but can assign a bridge post-creation via `\u002Fapp\u002Fset network=\u003Cbridge>` |\n| Multi-container | Manual per-container setup | Declarative YAML, multiple services |\n| Use case | Raw L2 access (netinstall, DHCP relay, etc.) | Standard app deployment with port forwarding |\n\nNetinstall specifically requires L2 bridge access for BOOTP\u002FTFTP, which is why the manual VETH+bridge approach is used rather than \u002Fapp. For typical containers that only need port-forwarded TCP\u002FUDP services, `\u002Fapp` is simpler.\n\n## Additional Resources\n\n**Related skills:**\n- For netinstall and device-mode automation: see the `routeros-netinstall` skill\n- For building OCI images compatible with RouterOS: see the `tikoci-oci-image-building` skill\n- For the \u002Fapp YAML format: see the `routeros-app-yaml` skill\n- For general RouterOS fundamentals (CLI, REST, scripting): see the `routeros-fundamentals` skill\n\n**MCP tools:**\n- For RouterOS documentation and property lookups: use the `rosetta` MCP server tools (`routeros_search`, `routeros_get_page`, `routeros_search_properties`)\n\n**External docs:**\n- MikroTik official docs: https:\u002F\u002Fhelp.mikrotik.com\u002Fdocs\u002Fspaces\u002FROS\u002Fpages\u002F84901929\u002FContainer\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Ftikoci\u002Frouteros-container",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill routeros-container",{"tool":59,"command":60},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill routeros-container",{"tool":62,"command":63},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill routeros-container","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Ftikoci\u002Frouteros-container\u002FSKILL.md",true,[67],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"skill-report.json","REFERENCE","参考文档",13236,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Ftikoci\u002Frouteros-container\u002Fskill-report.json",[74,83,92,101,107,113],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":39},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[80,81,82],"model","model hierarchy","model hierarchy skill",{"skillNo":84,"name":85,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":39},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[89,90,91],"MCP","zoom","zoom mcp",{"skillNo":93,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":39},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[98,99,100,90],"sdk","zoom apps sdk","apps",{"skillNo":102,"name":103,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":39},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[103],{"skillNo":108,"name":109,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":39},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[109],{"skillNo":114,"name":115,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":39},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[115]]