@@ -44,6 +44,38 @@ When running with the container you will need to mount the `device.yml` obtained
4444docker run --mount type=bind,src=/path/to/device.yml,target=/opt/flowfuse-device/device.yml -p 1880:1880 flowfuse/device-agent:latest
4545```
4646
47+ Alternatively, you can mount the entire configuration directory:
48+
49+ ``` bash
50+ docker run --mount type=bind,src=/path/to/config/dir,target=/opt/flowfuse-device -p 1880:1880 flowfuse/device-agent:latest
51+ ```
52+
53+ > [ !IMPORTANT]
54+ > ** Breaking change in 4.0.0 — the container now runs as a non-root user.**
55+ >
56+ > From ` 4.0.0 ` the image runs as the unprivileged ` flowfuse ` user (` UID 2000 ` /
57+ > ` GID 2000 ` ) instead of ` root ` . If you bind-mount a host directory for state
58+ > (e.g. at ` /opt/flowfuse-device ` to persist ` device.yml ` , the ` project/ `
59+ > directory and the module cache), that directory must be ** writable by UID
60+ > 2000** , otherwise the agent will fail to start with a permissions error.
61+ >
62+ > Before upgrading, change the ownership of the mounted directory on the host:
63+ >
64+ > ``` bash
65+ > sudo chown -R 2000:2000 /path/to/config/dir
66+ > ` ` `
67+ >
68+ > Alternatively, run the container as a UID that already owns the host
69+ > directory (the agent only requires the state directory to be writable by the
70+ > runtime user):
71+ >
72+ > ` ` ` bash
73+ > docker run --user $( id -u) :$( id -g) ... flowfuse/device-agent:latest
74+ > ` ` `
75+ >
76+ > If you build the image yourself, the user and group IDs can be customised with
77+ > the ` FF_UID` and ` FF_GID` build arguments.
78+
4779# # Configuration
4880
4981The agent configuration is provided by a ` device.yml` file within its working
0 commit comments