Skip to content

[WIP] Dockerfile for Raspberry Pi [armhf] #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM python:3.7-slim-buster
WORKDIR /code
RUN sed -i "s#deb http://deb.debian.org/debian buster main#deb http://deb.debian.org/debian buster main contrib non-free#g" /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
wget \
gcc \
g++ \
firefox-esr \
# cryptography build dependencies
libffi-dev \
libssl-dev \
# for building geckodriver from source
curl \
unzip \
# cross-compiler toolchain
gcc-arm-linux-gnueabihf \
libc6-armhf-cross \
libc6-dev-armhf-cross \
# rust language for building cryptography and geckodriver
&& curl https://sh.rustup.rs -sSf | sh -s -- -y \
&& . $HOME/.cargo/env \
&& rustup target install armv7-unknown-linux-gnueabihf \
&& wget https://hg.mozilla.org/mozilla-central/archive/tip.zip \
&& unzip tip.zip \
&& mv mozilla-central-* mozilla-central \
&& rm tip.zip \
&& printf "[target.armv7-unknown-linux-gnueabihf]\nlinker = \"arm-linux-gnueabihf-gcc\"" >> mozilla-central/testing/geckodriver/.cargo/config \
&& cd mozilla-central/testing/geckodriver \
&& cargo build --release --target armv7-unknown-linux-gnueabihf \
&& cd - \
&& cp mozilla-central/target/armv7-unknown-linux-gnueabihf/release/geckodriver /usr/bin/ \
&& rm -rf mozilla-central \
&& wget -O '/tmp/requirements.txt' https://raw.githubusercontent.com/InstaPy/instapy-docker/master/requirements.txt \
&& pip install --no-cache-dir -U -r /tmp/requirements.txt \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/requirements.txt \
# Disabling geckodriver log file
&& sed -i "s#browser = webdriver.Firefox(#browser = webdriver.Firefox(service_log_path=os.devnull,#g" /usr/local/lib/python3.7/site-packages/instapy/browser.py
COPY *.py /code/
CMD ["python", "docker_quickstart.py"]