Docker file that runs off Ubuntu 16.04 to allow public urls to be added to capture screen shots.
498
Purpose: To create a self contained ecosystem around the ability to take a public URL and create a screen shot, which then would be sent over SMTP to a specified individual.
Prerequisites:
Allow less secure apps: ON Information can be found here: https://support.google.com/accounts/answer/6010255?hl=enRun commands:
The code below will allow you to set ENV Variables into your Docker Container along with providing the REQUIRED fields in the format below:
docker run -d --env FROM_ADDRESS=[[email protected]] --env EMAIL_PASSWORD=[PASSWORD_HERE] --env SUBJECT=["This is an example of a subject"] --env TO_ADDRESS=[[email protected]] --env SAVE_LOCATION=[FILE_NAME_AND_PATH_TO_STORE_IMAGE] --env SMTP_ADDRESS=smtp.gmail.com:587 --name [PROVIDE_CONTAINER_NAME_ALIAS] jaycdave88/dockerscreenshot
Once everything has been downloaded, run the following command:
docker container exec [PROVIDE_CONTAINER_NAME_ALIAS_WHICH_WAS_DEFINED_ABOVE_IN_STEP_1] /usr/bin/xvfb-run -a /usr/bin/wkhtmltoimage --javascript-delay 20000 "[LINK_TO_PUBLIC_URL]" [FILE_NAME_AND_PATH_TO_STORE_IMAGE_PREVIOUSLY_SET_IN_STEP_1]; docker container exec [PROVIDE_CONTAINER_NAME_ALIAS_WHICH_WAS_DEFINED_ABOVE_IN_STEP_1] python3 /usr/bin/dd-email.py
(NOTE: All items noted above surrounded with [ ] will need to be replaced with appropriate fields.)
(P.S. Make sure you check your Spam folder for your email - incase the message was sent there)
Enhancements:
The ability to send emails to multiple recipients. In order to achieve this, just update the TO_ADDRESS with the format below:
TO_ADDRESS="[email protected], [email protected], "[email protected]"
Content type
Image
Digest
Size
217.7 MB
Last updated
over 8 years ago
docker pull jaycdave88/dockerscreenshot