Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-user:virtualization:docker_host [2023/12/28 22:18] – [Install Docker Community Edition] fixed package name palebloodsky | docs:guide-user:virtualization:docker_host [2024/10/08 16:59] (current) – [Docker Community Edition] luci-app-dockerman now depends on dockerd stokito | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ======= OpenWrt as Docker container host ======= | ======= OpenWrt as Docker container host ======= | ||
| - | OpenWrt can be a [[wp> | + | [[wp> |
| - | There are two ways to use Docker as a host, install Docker Community Edition, | + | To run containers, users may install Docker Community Edition, use native OpenWrt tools, or use Podman. While Docker |
| - | You will probably need to [[docs: | + | ===== Prerequisites ===== |
| - | Also in most cases you will be running the container as a specific user and will give it access to some folder outside the container, where it can store its configuration and the data. So you will probably | + | For devices with small flash partitions |
| - | ===== Install Docker Community Edition ===== | + | Also in many cases you will be running the container as a specific user that will need access to some folder outside the container |
| - | * Install **luci-app-dockerman** to get a control panel for containers in Luci along with CLI docker | + | |
| - | * Install **docker** | + | |
| - | The default folder for docker in the dockerman luci interface is **/opt/docker** so you want to mount your storage at **/opt** or change the folder in **Docker** > **Overview** > **Docker | + | ===== Docker Community Edition ===== |
| + | First you need to install | ||
| + | It provides an [[https://docs.docker.com/engine/ | ||
| - | ==== Adding images ==== | + | Then you need a //client// e.g. '' |
| + | To save space you can use the '' | ||
| - | To add an image, search for it on [[https:// | + | As a GUI client install '' |
| + | |||
| + | The default folder for docker in the dockerman Luci interface is **/ | ||
| + | |||
| + | |||
| + | ==== Adding images ==== | ||
| + | Search for an image on [[https:// | ||
| In Luci go to **Docker** > **Images** and paste that text in the **Pull Image** box, then click **Pull**. The page will show the download progress. | In Luci go to **Docker** > **Images** and paste that text in the **Pull Image** box, then click **Pull**. The page will show the download progress. | ||
| - | Note for larger container pulls Luci might timeout, so you will need to use the command line. For example, | + | Note for larger container pulls LuCI might timeout, so you will need to use the command line. For example, |
| - | Then in Luci go to **Docker** > **Containers** > **Add**. In the new container page select the docker image from the **Docker Image** menu, then set all other parameters (usually the available/ | + | Once you have your images, |
| - | ==== Configure | + | ==== Configure |
| Config is located in ''/ | Config is located in ''/ | ||
| Line 47: | Line 54: | ||
| - | + | ===== Native | |
| - | ===== Use native | + | Instead of running Docker CE users may want to use the procd init system |
| - | Procd init system | + | |
| - | The uxc command line tool handles the basic operations on containers as defined by the spec.\\ | + | |
| - | This allows to use it as a drop-in replacement for Docker' | + | |
| Detailed but possibly outdated info available on https:// | Detailed but possibly outdated info available on https:// | ||
| - | ==== install packages ==== | ||
| - | For 20.0x install the following: | ||
| - | < | ||
| - | opkg install kmod-veth uxc ujail-console | ||
| - | </ | ||
| - | |||
| - | For newer snapshots: | ||
| + | ==== Install packages ==== | ||
| + | Install the following: | ||
| < | < | ||
| opkg install kmod-veth uxc procd-ujail procd-ujail-console | opkg install kmod-veth uxc procd-ujail procd-ujail-console | ||
| </ | </ | ||
| - | ==== create | + | |
| + | ==== Create | ||
| < | < | ||
| uci batch <<EOF | uci batch <<EOF | ||
| Line 84: | Line 84: | ||
| </ | </ | ||
| - | ====creating | + | ==== Creating |
| To create an OCI run-time bundle, which is needed for uxc, follow these steps. | To create an OCI run-time bundle, which is needed for uxc, follow these steps. | ||
| Line 102: | Line 102: | ||
| This is quite cumbersome. If someone knows a better way, please do update this page. | This is quite cumbersome. If someone knows a better way, please do update this page. | ||
| - | ====import | + | ==== Import |
| (assuming OCI run-time bundle with config.json in / | (assuming OCI run-time bundle with config.json in / | ||
| < | < | ||
| Line 118: | Line 118: | ||
| ===== Podman ===== | ===== Podman ===== | ||
| - | https:// | + | https:// |
| Here is example setup using podman to create web server container with proxy. | Here is example setup using podman to create web server container with proxy. | ||