When running EPUBCheck in a Docker container, you must map a directory from your host machine to the /data path inside the container using a Docker volume. This /data path acts as a bridge to allow the container to access your EPUB files and write output files back to your host.
Basic Commands
To view help:
$ docker run -it --rm -v <directory>:/data epubcheck --help
To run a check on an EPUB file:
$ docker run -it --rm -v <directory>:/data epubcheck <epub-file> [OPTIONS]
Usage Examples
Example 1: Check a file and print output to console
If your file is located at /home/username/file.epub on the host:
$ docker run -it --rm -v /home/username:/data epubcheck file.epub
Example 2: Check a file and generate a JSON output file
To generate an output file that will be accessible on your host at /home/username/output.json:
$ docker run - --rm -v /home/username:/data epubcheck file.epub --json output.json