# Python Scripts with docker

**URL:** <https://forum.collaboraonline.com/t/python-scripts-with-docker/3953>\
**Category:** Installation & Configuration\
**Created:** [August 15, 2025, 8:22am UTC](https://forum.collaboraonline.com/t/python-scripts-with-docker/3953 "2025-08-15T08:22:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolio](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@coolio](https://forum.collaboraonline.com/u/coolio)\
**Post date:** [August 15, 2025, 8:22am UTC](https://forum.collaboraonline.com/t/python-scripts-with-docker/3953/1 "2025-08-15T08:22:23Z")

</div>

Hello everyone!

I’m trying to run CODE image with Python scripts locally. It was just `docker pull collabora/code`, then `docker run … -e extra_params="--o:security.enable_macros_execution=true --o:security.macro_security_level=0"` didn’t help. After this I see the button to run macros in the ‘File’ tab, but clicking on it show list of some, I assume, default macros, but they can not be run. I tried to bind-mount some python scripts with `docker run -v ~/macros/python:/opt/collaboraoffice/Scripts/python`(~/macros/python is not empty), but nothing changed in the list.

Am I missing something? Maybe the only way to add macros is building from source with adding `COPY ~/macros/python /opt/collaboraoffice/Scripts/python` to Dockerfile, and do i have to install collaboraofficebasis-python-script-provider and collaboraofficebasis-pyuno on local machine in that case?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [August 18, 2025, 7:00am UTC](https://forum.collaboraonline.com/t/python-scripts-with-docker/3953/2 "2025-08-18T07:00:50Z")

</div>

hii @coolio

**The most reliable way to include your Python macros is to build a custom Docker image.**

**Why:**

- **Guaranteed Inclusion:** Simply volume mounting (`-v`) might not always trigger the Collabora Online server to pick up new scripts immediately.
- **Persistence:** Your macros will be part of the image, available every time you run the container.

**How:**

1. **Create a `Dockerfile`:**

2. **Build the image:**

3. **Run your custom image:**

Ensure the macro execution parameters (`--o:security.enable_macros_execution=true --o:security.macro_security_level=0`) are correctly passed to the `docker run` command if needed.

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [August 22, 2025, 11:47am UTC](https://forum.collaboraonline.com/t/python-scripts-with-docker/3953/3 "2025-08-22T11:47:21Z")

</div>


