Can't execute cp command to a samba share using nodered

Hello.

I have a problem with a network share an the node-red integration, particularly the exec command.
The command is a very simple copy one:

cp /config/www/cam_captures/ojo_interior.jpg /config/samba/camera/1613148935618.jpg

That is the string that I generate and I pass down to the exec command. If I copy paste that command on the shell it works perfectly, but If I execute the flow it does nothing. No error, the output status is 0, but the file is not copied.
What can be going on here?

The flow is simple as hell:


[
    {
        "id": "a03ab777.710698",
        "type": "debug",
        "z": "f92c309a.afade",
        "name": "hook",
        "active": false,
        "tosidebar": true,
        "console": true,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 930,
        "y": 620,
        "wires": []
    },
    {
        "id": "271f9e23.20b8d2",
        "type": "exec",
        "z": "f92c309a.afade",
        "command": "",
        "addpay": true,
        "append": "",
        "useSpawn": "false",
        "timer": "",
        "oldrc": false,
        "name": "",
        "x": 710,
        "y": 720,
        "wires": [
            [],
            [],
            []
        ]
    },
    {
        "id": "9eeb7fdc.b058e",
        "type": "function",
        "z": "f92c309a.afade",
        "name": "build cmd",
        "func": "const file = msg.file\nconst share = '/config/samba/camera'\nconst d = new Date()\nmsg.payload = `cp ${file} ${share}/${Date.now()}.jpg`\nreturn msg",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 720,
        "y": 680,
        "wires": [
            [
                "271f9e23.20b8d2",
                "efc2f381.93dd3"
            ]
        ]
    },
    {
        "id": "efc2f381.93dd3",
        "type": "debug",
        "z": "f92c309a.afade",
        "name": "exec",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 960,
        "y": 720,
        "wires": []
    }
]

image

Ok, I think I found the key problem.
The node-red addon runs inside a docker container (this is how it works on hassio).
If I inspect the container, I see it has the following volumes available:

            "Volumes": {
                "/config": {},
                "/data": {},
                "/dev": {},
                "/media": {},
                "/share": {},
                "/ssl": {}
            },

I guess the data is where the “data” is supposed to be mounted.
To check if the problem is that the FS inside the docker container does, or does not, match the out one, I executed the following

docker exec -it addon_a0d7b954_nodered /bin/sh

There, I can check that the origing /config exists and contains all the data that I expect.
The folder where the samba share is mounted, also exists, and guess what? All the files are that I tried to copy are there, but none of the ones that the samba share contain.

My understanding is that the share is being mounted as a normal folder, and the data is being copied to the folder inside the container on the local filesystem, but outside the container what I see are the actual content of the share because it is mounted there.