matrix-commander/docker/README.adoc

117 lines
3.7 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

= matrix-commander on Docker Hub
If you want to run `matrix-commander` using Docker, there is an official image
available on https://hub.docker.com/r/matrixcommander/matrix-commander[Docker Hub]
built from source on each commit and hence easier to run, since only Docker is
required (:clap: to @pataquets for his PR).
The image is based on the latest version of Fedora (37 as of Aug '23).
There is a `linux/amd64` and a `linux/arm64` version available.
Download/update your local image pulling it by doing:
```
docker pull matrixcommander/matrix-commander
```
When using Docker, it is recommended to use the `--no-sso` flag because
there is no browser available to perform web-based Single Sign-On.
= matrix-commander with Docker
NOTE: In the following docker commands, the option `:z` is here to make sure that the commands work in systems that use SELinux (eg. Fedora).
For other systems, this options has no influence and can be ignored or removed.
The provided `Dockerfile` builds `matrix-commander` using Fedora 35. If you want to use `Debian`, `Ubuntu` or otherwise, you *must* adjust the `Dockerfile` (e.g. change `dnf` to `apt` and so forth).
== Building the image
From the root folder of the git repository, run:
```
docker build -t matrix-commander -f docker/Dockerfile .
```
This will create an image called `matrix-commander`.
Alternatively, you can build the Docker image directly from sources, without cloning the repo:
```
docker build -t matrix-commander -f docker/Dockerfile github.com/8go/matrix-commander
```
== Using the image
This image requires a folder where `matrix-commander` will store data for credentials and end-to-end encryption.
This folder must be provided to further `run` commands using the `/data` mountpoint.
=== Initialization (only do this once)
Run this command to initialize the `matrix-commander` data folder with new credentials you must answer all the questions that will pop up interactively (homeserver, username, etc.):
```
docker run --rm -ti -v /my/chosen/folder:/data:z matrix-commander --login password
```
You can now use this data folder to send messages or verify your session.
=== Send a message to a room
Given an initialized data folder, run this command to send a message to a room:
```bash
docker run --rm -v /my/chosen/folder:/data:z matrix-commander -r "<room id>" -m "<some message>"
```
=== Verify the session
Given an initialized data folder, run this command to start the verification of the matrix-commander session from another existing matrix session:
```
docker run --rm -ti -v /my/chosen/folder:/data:z matrix-commander --verify
```
=== How to deal with pipes
When using docker, please understand how docker works with pipes. Read issue https://github.com/8go/matrix-commander/issues/27
This has nothing to do with matrix-commander, but nontheless here are some examples.
In a nutshell:
```bash
df -h | docker run --rm -v ./data:/data matrix-commander --code
```
The above line will *NOT* work. This is not how pipes work in docker.
```bash
docker run --rm -ti -v ./data:/data matrix-commander -k -m "$(df -h| head -2)"
```
The above line works, as there is no pipe into docker.
```bash
df -h | head -2 | docker run --rm -i -v ./data:/data matrix-commander --code
```
The above line works, because -t is *NOT* used.
= matrix-commander with Docker on Raspberry Pi (4b, 32bit, running buster of Raspberry Pi OS)
See Issue https://github.com/8go/matrix-commander/issues/25 for more info:
The libraries
```
libffi-devel libjpeg-devel zlib-devel
```
were added to the
```
dnf install
```
command.
The command
```
pip3 install wheel &&
```
was added to the
```
pip3 install
```
command.
See commit
https://github.com/8go/matrix-commander/commit/5089d71513685bec6443388dcd105d177191a25e
.