Take Webpage screenshots from command line with PhantomJS and save them to the disk.
3.9K
A web screenshot container based on phantomjs's rasterize.js.
Based on a phantomjs container.
Run the following command:
$ docker run --rm -v $PWD:/srv lifenz/docker-screenshot https://google.com test.png 1920px 2000 1
Such as: test.png -> file name to be saved 1920px -> the resolution of the target picture 2000 -> the time to wait in ms 1 -> the page zoom factor
$ git clone [email protected]:ngsimon/docker-screenshot.git
$ cd docker-screenshot
$ docker build -t screenshot .
Because phantomjs runs inside the container, you need to bind mount a volume to retrieve the screenshot.
The container is configured to write screenshots to /srv, so bind-mounting $PWD (or whatever directory you want to screenshot created in) to it seems like a good idea.
$ docker run --rm -v $PWD:/srv screenshot https://google.com test.png 1920px 2000 1
Such as: test.png -> file name to be saved 1920px -> the resolution of the target picture 2000 -> the time to wait in ms 1 -> the page zoom factor
Based on the original project: https://github.com/ubermuda/docker-screenshot Modified sources: https://github.com/ngsimon/docker-screenshot
Content type
Image
Digest
sha256:cd24c150b…
Size
895.9 MB
Last updated
4 months ago
docker pull lifenz/docker-screenshot