Skip to content

Instantly share code, notes, and snippets.

@Yoric
Last active December 17, 2020 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yoric/9e54dadb39f31d68f35c86d5102ed001 to your computer and use it in GitHub Desktop.
Save Yoric/9e54dadb39f31d68f35c86d5102ed001 to your computer and use it in GitHub Desktop.
matrix Dockerfile
FROM matrixdotorg/synapse:latest
# Install extension.
WORKDIR /tmp/iwf-filter
COPY . .
RUN pip install .
# Customize homeserver.yaml
COPY test/homeserver.yaml /data/homeserver.yaml
# Run
RUN chown -R 991:991 /data
EXPOSE 8008/tcp 8009/tcp 8448/tcp
@Yoric
Copy link
Author

Yoric commented Dec 17, 2020

$ docker build -t test . && docker run --mount type=volume,src=synapse-data,dst=/data -t test
Sending build context to Docker daemon    300kB
Step 1/7 : FROM matrixdotorg/synapse:latest
 ---> d1fbf58c7fae
Step 2/7 : WORKDIR /tmp/iwf-filter
 ---> Using cache
 ---> 634bfc8121e4
Step 3/7 : COPY . .
 ---> 0fd6fcb5f5c4
Step 4/7 : RUN pip install .
 ---> Running in 999c257d9ca8
Processing /tmp/iwf-filter
Collecting linkify-it-py
  Downloading linkify_it_py-1.0.0-py3-none-any.whl (19 kB)
Collecting uc-micro-py
  Downloading uc_micro_py-1.0.1-py3-none-any.whl (6.2 kB)
Building wheels for collected packages: synapse-spamcheck-badlist
  Building wheel for synapse-spamcheck-badlist (setup.py): started
  Building wheel for synapse-spamcheck-badlist (setup.py): finished with status 'done'
  Created wheel for synapse-spamcheck-badlist: filename=synapse_spamcheck_badlist-0.1.0-py3-none-any.whl size=14444 sha256=d76be8a9d4738cfc83cb9fd643d73c1c91582a842cb3eb8eee3783bdefc01c09
  Stored in directory: /root/.cache/pip/wheels/68/3e/a8/a1c1f166dea6cc8412028d63d1ce1cfcc9bf7ea77d6d413258
Successfully built synapse-spamcheck-badlist
Installing collected packages: uc-micro-py, linkify-it-py, synapse-spamcheck-badlist
Successfully installed linkify-it-py-1.0.0 synapse-spamcheck-badlist-0.1.0 uc-micro-py-1.0.1
WARNING: You are using pip version 20.3.1; however, version 20.3.3 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Removing intermediate container 999c257d9ca8
 ---> f97b24d7dc85
Step 5/7 : COPY test/homeserver.yaml /data/homeserver.yaml
 ---> 5954dd9e1db9
Step 6/7 : RUN chown -R 991:991 /data
 ---> Running in 62b86e1bb268
Removing intermediate container 62b86e1bb268
 ---> 52d93304d44f
Step 7/7 : EXPOSE 8008/tcp 8009/tcp 8448/tcp
 ---> Running in dad73b6c3ce1
Removing intermediate container dad73b6c3ce1
 ---> 4bb2fa960d2b
Successfully built 4bb2fa960d2b
Successfully tagged test:latest
Starting synapse with args -m synapse.app.homeserver --config-path /data/homeserver.yaml
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/site-packages/synapse/app/homeserver.py", line 512, in <module>
    main()
  File "/usr/local/lib/python3.8/site-packages/synapse/app/homeserver.py", line 507, in main
    hs = setup(sys.argv[1:])
  File "/usr/local/lib/python3.8/site-packages/synapse/app/homeserver.py", line 341, in setup
    config = HomeServerConfig.load_or_generate_config(
  File "/usr/local/lib/python3.8/site-packages/synapse/config/_base.py", line 721, in load_or_generate_config
    obj.parse_config_dict(
  File "/usr/local/lib/python3.8/site-packages/synapse/config/_base.py", line 740, in parse_config_dict
    self.invoke_all(
  File "/usr/local/lib/python3.8/site-packages/synapse/config/_base.py", line 369, in invoke_all
    res[name] = getattr(config, func_name)(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/synapse/config/repository.py", line 107, in read_config
    self.media_store_path = self.ensure_directory(
  File "/usr/local/lib/python3.8/site-packages/synapse/config/_base.py", line 182, in ensure_directory
    os.makedirs(dir_path)
  File "/usr/local/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/data/media_store'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment