1. Get Docker image as tar archive and copy to router (currently there is no 'pull' command in RouterOS, so containers should be exported from a working Docker environment). Also note that container's architecture should match with the router's.
-----------------------------------------------------
$ docker pull docker/example-container
$ docker save docker/example-container > my-container.tar
2. Add veth interface for the container
---------------------------------------
[admin@MikroTik] > /interface/veth/add name=veth1 address=172.17.0.2/16 gateway=172.17.0.1
3. Create bridge for containers and add veth to it
--------------------------------------------------
[admin@MikroTik] > /interface/bridge/add name=docker
[admin@MikroTik] > /ip/address/add address=172.17.0.1/16 interface=docker
[admin@MikroTik] > /interface/bridge/port add bridge=docker interface=veth1
4. Setup NAT for outgoing traffic
---------------------------------
[admin@MikroTik] > /ip/firewall/nat/add chain=srcnat action=masquerade src-address=172.17.0.0/16
5. Create environment variables for container if needed
-------------------------------------------------------
[admin@MikroTik] > /container/envs/add list=foo name=SECRET value=12345678
[admin@MikroTik] > /container/envs/add list=foo name=FOO value=bar
6. Define mounts if needed
--------------------------
[admin@MikroTik] > /container/mounts/add name=etc src=disk1/etc dst=/etc
[admin@MikroTik] > /container/mounts/add name=opt src=disk1/opt dst=/opt
If ``src`` directory does not exist on first time use then it will be populated
with whatever container have in ``dst`` location.
7. Create container from image tar
----------------------------------
[admin@MikroTik] > /container/add file=my-container.tar interface=veth1 envlist=foo root-dir=disk1/foo mounts=etc,opt
Use ``logging=yes`` to see container output in log with tags
``container,debug,info``.
8. Make sure container has been added and status is stopped
-----------------------------------------------------------
[admin@MikroTik] > container/print
9. Redirect port 8080 traffic to container
------------------------------------------
[admin@MikroTik] > /ip/firewall/nat/add chain=dstnat action=dst-nat to-addresses=172.17.0.2 to-ports=80 protocol=tcp dst-port=8080
10. Start container
-------------------
[admin@MikroTik] > /container/start 0
Docker is one of many implementations for running containers. More about containerization.
In short: this is advanced stuff that will replace metarouter, but is much more flexible. If one doesn’t know what to do with metarouter, then likely he won’t know what to do with docker.
Wow! They did it!
That should put an end to the many +1 +1 +1 topics once and for all.
Now most requested features can simply be added by users, instead of always having to go to MikroTik with requests for niche stuff.
Actually we can start a few +1 threads about removing some useless functionality from system package … One prime example would be support for SMB (file services). Or (borken) DNS service. Or (your suggestion here).
It would be nice when available packages could be listed and installed from the packages menu!
Either on a separate window or by just listing all packages and have some status like not installed, disabled, installed.
(so you can install a package just as easily as you can uninstall, disable or upgrade it)