captainhook
captainhook copied to clipboard
Invalid configuration path
I configured captainhook and I get an error with the configuration path.
This is due to the wrong path:
The right path for me: /api/captainhook.json (with slash)
but I can't put it in any way.
My command: captainhook install -f -s -c "/api/captainhook.json"
the first slash is always ignored
https://github.com/captainhookphp/captainhook/blob/64b405d6ad85a3ac8484e7e2a3a9b14b180a1bd6/src/Hook/Template/Docker.php#L87
this is where the slash is lost
I know it is a bit counter intuitive that the relative path is used no matter what you do and especially for docker setups it would be best to use absolute path anyway. I will do some testing and make sure everything still works if I use the absolute path in that position. But this will take a bit of time.
In the meantime, you can specify the working directory for the docker exec
command or define a default working dir in your container file.
Add working directory to exec command
{
"config": {
"run-mode": "docker",
"run-exec": "docker exec CONTAINER_NAME --workdir=/"
},
...
}
Define container working directory in your docker file
WORKDIR /
@sebastianfeldmann, so, what is the verdict?
Have you tried to define your working directory for your container?
yes, it will work for WORKDIR /
.
but this is not a solution to the problem when other WORKDIR.
now I have a lot of crutches in other commands.
🤔 good point, I will look into it a bit further