🖥
#docker + #Centos で headless #GoogleChrome を使って URL指定でキャプチャ画像を作成する
docker run -it centos
yum -y install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
yum -y install https://rpmfind.net/linux/centos/7.7.1908/os/x86_64/Packages/ipa-gothic-fonts-003.03-5.el7.noarch.rpm
google-chrome --headless --disable-gpu --no-sandbox -window-size=1024,768 --hide-scrollbars --screenshot='yahoo.png' https://www.yahoo.co.jp
docker ps
docker cp <CONTAINER_ID>:/yahoo.png ./ && open yahoo.png
参考
Amazon Linux 2 で Headless Chrome を動かしてみた - Qiita
Original by Github issue
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
公開日時
2019-10-29
Discussion