Skip to content

Commit fe72e40

Browse files
wloxyzSaijin-Naib
authored andcommitted
Added documentation on using Podman
1 parent d5da8ef commit fe72e40

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

source/tutorials.rst

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,65 @@ Cleaning up after Docker
520520

521521
Docker has a lamentable use of space and by default does not clean up excess data and machines when processes are complete. This can be advantageous if we need to access a process that has since terminated, but carries the burden of using increasing amounts of storage over time. Maciej Łebkowski has an `excellent overview of how to manage excess disk usage in docker <https://lebkowski.name/docker-volumes/>`_.
522522

523+
************
524+
Using Podman
525+
************
526+
As an alternative to Docker, one may choose to run WebODM using `Podman <https://podman.io>`. To do so, simply install your distribution's podman package as well as its compatibility layer for docker. For example, on Alpine Linux:
527+
::
528+
$ apk add podman podman-docker
529+
530+
The Podman command line bears strong resemblance to the Docker one, so referring to the past section and replacing every ``docker`` command invocation with ``podman`` is likely sufficient to teach its basic use.
531+
532+
Migrating from Docker to Podman
533+
===============================
534+
Unfortunately, given the number of options ``webodm.sh`` provides for deployment, migrating between the two may require some manual work before switching platforms. If WebODM's information was stored in directories using the ``--media-dir`` and ``--db-dir`` flags, then the data within those needs to be owned by the user running the Podman containers. If running rootlessly, be sure to set this to your current user. You should be safe to recursively chown the whole git repository as such if your ``media-dir`` and ``db-dir`` lives within it:
535+
::
536+
sudo chown -R $(whoami) WebODM
537+
538+
If ``webodm.sh`` was used without flags, then a different intervention is necessary to migrate their data.
539+
::
540+
$ docker volume export webodm-dbdata > webodm-dbdata.tar
541+
$ docker volume export webodm-appmedia > webodm-appmedia.tar
542+
543+
Regardless of data location, you'll now need to uninstall Docker completely from your system according to your operating system's documentation. Note that, by default, the ``webodm.sh`` script may have taken the liberty of installing docker-compose for you. To clean that up, run the following:
544+
::
545+
$ rm ~/.docker/cni-plugins-docker-compose
546+
547+
Now, install Podman according to your operating system's documentation. If you needed to export the media and db dirs from Docker before, you may now use it to import the volumes.
548+
::
549+
$ podman volume import webodm-dbdata webodm-dbdata.tar
550+
$ podman volume import webodm-appmedia webodm-appmedia.tar
551+
552+
It is recommended that you log out and log back in to your system at this point to ensure all environment variables are properly sourced.
553+
554+
Running ``webodm.sh`` now should result in user data persisting between the switch.
555+
556+
For versions of podman-compose < 1.5.0
557+
======================================
558+
559+
podman-compose versions lower than 1.5.0 lack support for environment variables in docker-compose files. If your distribution does not provide an up to date version in its repositories, you can choose to either provide your own up-to-date binary or use the `Docker Compose <https://docs.docker.com/compose/install/linux/#install-the-plugin-manually>`_ with podman itself. In either case, you'll need to update the compose_providers line of the ``/etc/containers/containers.conf`` file.
560+
561+
If you choose to use Docker Compose instead of podman-compose, you might need to configure a few extra environment variables to tell WebODM where to send its Docker API requests to. The following environment configuration resulted in WebODM successfully spawning in Alpine Linux 3.22, though it should be fairly agnostic across distros.
562+
::
563+
$ export WEBODM_PODMAN_SOCKET=$(podman info --format '{{.Host.RemoteSocket.Path}}')
564+
$ mkdir -p $(dirname WEBODM_PODMAN_SOCKET)
565+
$ export DOCKER_HOST=unix://$WEBODM_PODMAN_SOCKET
566+
Finally, start WebODM as such:
567+
::
568+
$ podman system service --time=0 unix://$WEBODM_PODMAN_SOCKET & ./webodm.sh start
569+
570+
Configuring Podman to run Rootlessly
571+
====================================
572+
A major benefit of using Podman instead of Docker is due to its ability to run rootlessly. Your specific operating system may or may not configure this for you manually, but generic instructions on doing so can be found `in Podman's official documentation <https://docs.podman.io/en/latest/markdown/podman.1.html#rootless-mode>`_. To surmise, executing the following commands is likely what you'll need to do:
573+
::
574+
$ sudo usermod --add-subuids 10000-75535 $(whoami)
575+
$ sudo usermod --add-subgids 10000-75535 $(whoami)
576+
577+
578+
MacOS
579+
=====
580+
In theory, `installing <https://podman-desktop.io/docs/installation/macos-install>`_ and running Podman Desktop from the official website should be all you need to use the ``webodm.sh`` script. Install and configure it for both `Docker compatibility <https://podman-desktop.io/docs/migrating-from-docker/customizing-docker-compatibility#enable-docker-compatibility>`_ and `Compose functionality <https://podman-desktop.io/docs/compose/setting-up-compose>`_.
581+
523582
*************************************
524583
Using ODM from low-bandwidth location
525584
*************************************

0 commit comments

Comments
 (0)