-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from darodi/master
docker files: define UID/GID for downloaded files, armv7 Dockerfile
- Loading branch information
Showing
5 changed files
with
124 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
git | ||
.gitignore | ||
Dockerfile* | ||
docker-compose* | ||
README.md | ||
LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
# this buld the base image to run comic_dl | ||
FROM python:3.6.5-slim-stretch AS base | ||
# build with command: | ||
# docker build -t comic-dl:py3.8-buster . | ||
# run with alias | ||
# alias comic_dl="docker run -it --rm -v $(pwd):/directory -w /directory comic-dl:py3.8-buster comic_dl -dd /directory" | ||
|
||
# this builds the base image to run comic_dl | ||
FROM python:3.8-slim-buster AS base | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -yq upgrade | ||
# update system & install basisc stuff | ||
# and dependencies for phantomjs | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq \ | ||
build-essential \ | ||
chrpath \ | ||
libssl-dev \ | ||
libxft-dev \ | ||
libfreetype6 \ | ||
libfreetype6-dev \ | ||
libfontconfig1 \ | ||
libfontconfig1-dev | ||
#wget nodejs-legacy | ||
# RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq \ | ||
# build-essential \ | ||
# chrpath \ | ||
# libssl-dev \ | ||
# libxft-dev \ | ||
# libfreetype6 \ | ||
# libfreetype6-dev \ | ||
# libfontconfig1 \ | ||
# libfontconfig1-dev | ||
|
||
# We're not using PhantomJS anymore. So, this step should be removed for now. | ||
# install phantomjs and symlink to /usr/local/bin/ | ||
#RUN wget -q https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 && \ | ||
# tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /usr/local/share/ && \ | ||
# ln -s /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/ | ||
ENV OWNER_UID=1000 | ||
ENV OWNER_GID=1000 | ||
|
||
# This install comic-dl and symlink to comic_dl command | ||
ENV PYTHONPATH "${PYTHONPATH}:/opt/comic-dl/comic_dl/" | ||
COPY / /opt/comic-dl | ||
RUN python -m pip install --upgrade pip && \ | ||
python -m pip install -r /opt/comic-dl/requirements.txt && \ | ||
chmod +x /opt/comic-dl/comic_dl/__main__.py && \ | ||
cp /opt/comic-dl/comic_dl/__main__.py /usr/local/bin/comic_dl | ||
chmod +x /opt/comic-dl/docker-init.sh && \ | ||
ln -s /opt/comic-dl/docker-init.sh /usr/local/bin/comic_dl && \ | ||
addgroup --gid ${OWNER_GID} comic-dl && \ | ||
adduser --disabled-password -home /home/comic-dl --gid ${OWNER_GID} --uid ${OWNER_UID} --gecos "" comic-dl | ||
|
||
USER comic-dl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# cross build it (it takes a few hours on x86_64), or be prepared to wait an eternity | ||
# build with command: | ||
# docker build -f Dockerfile.armv7 -t comic-dl:py3.8-buster-armv7 --platform linux/arm/v7 . | ||
# export with command | ||
# docker save -o comic-dl.tar comic-dl:py3.8-buster-armv7 | ||
# import on arm machine with command: | ||
# docker load --input comic-dl.tar | ||
# run with alias: | ||
# alias comic_dl="docker run -it --rm -v $(pwd):/directory -w /directory comic-dl:py3.8-buster-armv7 comic_dl -dd /directory" | ||
|
||
FROM python:3.8-slim-buster AS builder | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -yq upgrade \ | ||
&& apt-get install -yq \ | ||
build-essential \ | ||
chrpath \ | ||
git \ | ||
libssl-dev \ | ||
libfreetype6 \ | ||
libfreetype6-dev \ | ||
libfontconfig1 \ | ||
libfontconfig1-dev \ | ||
libjpeg-dev \ | ||
libqpdf-dev \ | ||
libxft-dev \ | ||
libxml2-dev \ | ||
libxslt1-dev \ | ||
python3-wheel \ | ||
zlib1g-dev | ||
|
||
## qpdf and pikepdf need to be built from source on armv7 | ||
RUN python -m pip install --upgrade pip \ | ||
&& pip install pybind11 \ | ||
&& cd /opt \ | ||
&& git clone https://github.com/qpdf/qpdf.git \ | ||
&& git clone https://github.com/pikepdf/pikepdf.git \ | ||
&& cd /opt/qpdf \ | ||
&& ./configure \ | ||
&& make \ | ||
&& make install \ | ||
&& cd /opt/pikepdf \ | ||
&& pip install . | ||
|
||
ENV OWNER_UID=1000 | ||
ENV OWNER_GID=1000 | ||
|
||
COPY / /opt/comic-dl | ||
RUN python -m pip install -r /opt/comic-dl/requirements.txt && \ | ||
chmod +x /opt/comic-dl/docker-init.sh && \ | ||
ln -s /opt/comic-dl/docker-init.sh /usr/local/bin/comic_dl && \ | ||
addgroup --gid ${OWNER_GID} comic-dl && \ | ||
adduser --disabled-password -home /home/comic-dl --gid ${OWNER_GID} --uid ${OWNER_UID} --gecos "" comic-dl | ||
|
||
USER comic-dl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env bash | ||
python /opt/comic-dl/cli.py "$@" |