A Docker container for automatically downloading a free eBook each day from Packt publishing using the packt-cli
tool.
To run the docker-packt-cli
container, use the following docker run
command:
docker run -d \
--name=packt --rm \
-e PACKT_EMAIL=<[email protected]> \
-e PACKT_PASSWORD=<password> \
-e PACKT_DOWNLOAD_FORMATS=pdf,epub,mobi,code \
-e PACKT_ANTICAPTCHA_KEY=<key> \
-e PACKT_SMTP_HOST <smtp.poczta.onet.pl> \
-e PACKT_SMTP_PORT <587> \
-e PACKT_SMTP_PASSWORD <youremailpassword> \
-e PACKT_SMTP_EMAIL <[email protected]> \
-e PACKT_SMTP_TO_EMAILS <[email protected], [email protected]> \
-e PACKT_SMTP_KINDLE_EMAILS <[email protected]> \
-e PUID=<UID> \
-e PGID=<GID> \
-e TZ=<timezone> \
-v /home/user/packt/config:/config \
-v /home/user/packt/books:/data \
--restart unless-stopped
ghcr.io/ghostwriters/docker-packt-cli:latest
You will need to replace <[email protected]>
and <password>
with your Packt account email and password, respectively. Additionally, you can customize the output formats of the downloaded books by modifying the PACKT_DOWNLOAD_FORMATS
environment variable. The default formats are pdf
, epub
, mobi
, and code
.
To automatically solve the CAPTCHA, you will need an AntiCaptcha API key, which you can set by attaching the -e PACKT_ANTICAPTCHA_KEY=<key>
flag to your docker run command.
PACKT_SMTP_HOST
, PACKT_SMTP_PORT
, PACKT_SMTP_PASSWORD
, PACKT_SMTP_EMAIL
, PACKT_SMTP_TO_EMAILS
, PACKT_SMTP_KINDLE_EMAILS
: These parameters are related to the email notifications feature. If you want to receive email notifications about the downloaded eBooks, you need to provide the SMTP server details and the email addresses for sending the notifications.
You can mount two volumes to persist the Packt credentials and store the downloaded books in a directory on your host system. The /config
directory will store your Packt credentials, and the /data
directory will store the downloaded books. You can change the paths of the host directories by modifying the values after the -v
flag.
If you would prefer to use an alternative to ghcr.io, you can use the image hosted on Docker Hub ghostwriters/docker-packt-cli:latest
,
- actions/checkout - Action for checking out code from a repository.
- actions/first-interaction - Action to identify a user's first contribution to a repository.
- actions/upload-artifact - Action for uploading artifacts for later use in the workflow.
- amannn/action-semantic-pull-request - Action for enforcing conventional commit messages and semantic versioning.
- anothrNick/github-tag-action - Action for automatically creating a new tag and release based on version numbers.
- docker/build-push-action - Action for building and pushing Docker images.
- docker/login-action - Action for logging in to a Docker registry.
- docker/metadata-action - Action for adding Docker metadata to a GitHub repository.
- docker/setup-buildx-action - Action for setting up Buildx on your Github Actions runner.
- docker/setup-qemu-action - Action for setting up QEMU for cross-builds.
- peter-evans/create-pull-request - Action for creating pull requests programmatically.
- softprops/action-gh-release - Action for creating GitHub releases.
- stefanzweifel/git-auto-commit-action - Action for automatically committing changes to a repository.
- oxsecurity/megalinter - Action for linting multiple languages at once.
If you have any feedback or run into issues with the container, please open an issue on the GitHub repository. If you would like to contribute to this project, you can submit a pull request.
- packt-cli for maintaining the package to handle the downloading.
- LinuxServer.io for maintaining the Docker image used in this project.
This project is licensed under the MIT License. See the LICENSE file for more details.