原項目:https://github.com/haq/microsoft-rewards-bot 只是Dockfile里的內(nèi)容作更改。 entrypoint.sh
#!/bin/sh
# pull the latest version of the app
git pull > /dev/null
# install any new dependencies
pip install --root-user-action=ignore -r requirements.txt > /dev/null
# set display port and dbus env to avoid hanging (https://github.com/joyzoursky/docker-python-chromedriver)
export DISPLAY=:99
export DBUS_SESSION_BUS_ADDRESS=/dev/null
# start vxfb
Xvfb :99 -screen 0 640x480x8 -nolisten tcp &
# start the script
exec "$@"
Dockerfile
FROM alpine:3.18
# install required pacakges
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && apk update
RUN apk --no-cache add chromium chromium-chromedriver git python3 python3-tkinter py3-pip xvfb
# create the app directory
WORKDIR /app
# clone the project
RUN git clone https:///github.com/farshadz1997/Microsoft-Rewards-bot.git ./
# install dependencies
#RUN pip install -r requirements.txt
RUN pip install -i https://pypi.tuna./simple/ -r requirements.txt
# copy over entrypoint script
COPY entrypoint.sh ./
#
ENTRYPOINT ["/app/entrypoint.sh"]
#
CMD ["python3", "ms_rewards_farmer.py", "--no-images", "--dont-check-for-updates", "--fast", "--skip-unusual", "--no-webdriver-manager", "--on-finish", "exit"]
構(gòu)建鏡像:
docker build -t microsoft-rewards-bot:V1 .
賬號密碼文件 accounts.json
[{
"username": "xxxxx1@qq.com",
"password": "密碼",
"mobile_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"
},
{
"username": "xxxx2@126.com",
"password": "密碼"
},
{
"username": "xxxx3@qq.com",
"password": "密碼",
"mobile_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"
}]
運行
docker run --rm -it -v "$PWD"/accounts.json:/app/accounts.json microsoft-rewards-bot:V1
|