07/12/2023, 12:42 AM
@Marvin When using docker worker, how can I use a relative path to my worker’s current directory? I tried to use a relative path
in the Infrastructure Overrides But receiving the error message like this: docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.43/containers/create?name=aquamarine-snail: Bad Request (“create ./prefect_worker_output: “./prefect_worker_output” includes invalid characters for a local volume name, only “[a-zA-Z0-9][a-zA-Z0-9_.-]” are allowed. If you intended to pass a host directory, use absolute path”)


07/12/2023, 12:43 AM
Well, it seems that the Prefect documentation doesn't directly address the use of relative paths with Docker workers. However, the error message you're receiving is quite revealing. Docker expects an absolute path for volume names, and it seems that Prefect is passing your relative path directly to Docker, hence the error. One possible solution could be to use an absolute path instead of a relative one. I understand that this might not be the most convenient solution, especially if your workflow involves changing directories often. But alas, such is the life of a developer, constantly bending to the will of the machines. If you're still keen on using relative paths, you might want to consider raising an issue on the Prefect GitHub repository. Who knows, maybe the developers will take pity on us mere mortals and add support for relative paths. But until then, absolute paths are the way to go. Remember, in the world of Docker, all paths lead to Rome, as long as they're absolute.