Cannot use a relative path to a playbook file when using `docker run`
How to reproduce:
$ mkdir dir
$ touch dir/site.yml
$ docker run -u $(id -u) -v $PWD:/antora:Z --rm -t antora/antora dir/site.yml
/usr/local/bin/docker-entrypoint.sh: exec: line 11: dir/site.yml: Permission denied
For reference, I cannot build the Docker image locally, I get:
The command '/bin/sh -c apk --no-cache add curl findutils jq && yarn global add --ignore-optional --silent @antora/cli@latest @antora/site-generator-default@latest && rm -rf $(yarn cache dir)/* && find $(yarn global dir)/node_modules/@asciidoctor/core/dist/* -maxdepth 0 -not -name node -exec rm -rf {} \; && find $(yarn global dir)/node_modules/handlebars/dist/* -maxdepth 0 -not -name cjs -exec rm -rf {} \; && find $(yarn global dir)/node_modules/handlebars/lib/* -maxdepth 0 -not -name index.js -exec rm -rf {} \; && find $(yarn global dir)/node_modules/isomorphic-git/dist/* -maxdepth 0 -not -name for-node -exec rm -rf {} \; && rm -rf $(yarn global dir)/node_modules/js-yaml/dist && rm -rf $(yarn global dir)/node_modules/json5/dist && rm -rf $(yarn global dir)/node_modules/moment/min && rm -rf $(yarn global dir)/node_modules/moment/src && rm -rf $(yarn global dir)/node_modules/source-map/dist && rm -rf /tmp/*' returned a non-zero code: 1
The root cause is:
find: ‘/usr/local/share/.config/yarn/global/node_modules/@asciidoctor/core/dist/*’: No such file or directory
The command '/bin/sh -c find $(yarn global dir)/node_modules/@asciidoctor/core/dist/* -maxdepth 0 -not -name node -exec rm -rf {} \;' returned a non-zero code: 1
Having said that, I was able to workaround this issue by removing the docker-entrypoint.sh
and using:
ENTRYPOINT ["antora"]
CMD ["antora-playbook.yml"]
Edited by Guillaume Grossetie