Skip to content

Latest commit

 

History

History
 
 

docker

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

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.

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.

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

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:

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 27 8go#27

This has nothing to do with matrix-commander, but nontheless here are some examples.

In a nutshell:

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.

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.

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 #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.