Once the backend/proxy portion is done, many people have asked for a docker container to run it.
Here's a quick & dirty attempt from a Docker newbie:
# Build with
#
# docker build -t bookmark-archiver .
#
# Run with
#
# docker run -v $(pwd):/data bookmark-archiver <bookmark_file>
#
FROM python:3.6-alpine
RUN \
apk --no-cache update \
&& apk --no-cache upgrade \
&& apk add chromium wget git curl \
&& rm -rf /var/cache/apk/* /tmp/*
ENV CHROME_BINARY chromium-browser
RUN \
pip install requests
ENV BOOKMARKARCHIVERDIR /bookmark-archiver
ADD . $BOOKMARKARCHIVERDIR
ENV DATADIR /data
WORKDIR $DATADIR
ENTRYPOINT ["/bookmark-archiver/archive"]
For some reason, chromium-browser segfaults, though. Any idea?
Edit: I forgot the to add curl :)
Edit 2: When specifying -e FETCH_PDF=False -e FETCH_DOM=False -e FETCH_SCREENSHOT=False on the docker command line to skip chromium completely, I noticed that the output directory is created in /bookmark-archiver (where ./archive is) although the current directory (set by WORKDIR) is /data and is shared with the host. Maybe that's the expected default behavior of bookmark-archiver?
Always creating ./output inside bookmark-archiver/ is the expected behavior right now, but I could change it to output to current dir, I didn't do that initially because the main use case for having multiple output folders is if they were hosting this as a service, and I want to eventually do that myself and charge for it so I can fund development of this project 馃榿
Not sure why chromium-browser is segfaulting, perhaps you can build the image on top of an already-working chromium docker image?
I haven't fixed the bug yet, but hacked my own version: linkbak.
Bug fixed on linkbak, here's the relevant Dockerfile. I ended up using another base image (stretch-slim instead of alpine), but I think it's not related. I had to tweak around sandboxing (--no-sandbox) and users/permissions to make it work.
I've now added a Dockerfile on master that works. A docker-compose.yml example with nginx to server the archive will come next.
CC: @hannah98 @ivar @ilvar @Strubbl @aurelg
You can use the new official docker image for Bookmark Archiver like so:
docker build github.com/pirate/bookmark-archiver -t bookmark-archiver
docker volume create archiver-output
docker run -v archiver-output:/home/chromeuser/app/archiver/output bookmark-archiver 'https://example.com/some/rss/feed.xml'
It's not perfect yet, I still have to make the ergonomics better for passing in link files to parse, right now you have to put them in the output volume and then reference them by their path inside the container to get BA to find them:
docker run -v archiver-output:/home/chromeuser/app/archiver/output bookmark-archiver /home/chromeuser/app/archiver/output/downloads/path-to-links.json
You're welcome to submit PRs if you find things that can be fixed/improved!
Closing this because it's been released and working fairly well for a while now: https://github.com/pirate/ArchiveBox/wiki/Docker
Most helpful comment
CC: @hannah98 @ivar @ilvar @Strubbl @aurelg
You can use the new official docker image for Bookmark Archiver like so:
It's not perfect yet, I still have to make the ergonomics better for passing in link files to parse, right now you have to put them in the output volume and then reference them by their path inside the container to get BA to find them:
docker run -v archiver-output:/home/chromeuser/app/archiver/output bookmark-archiver /home/chromeuser/app/archiver/output/downloads/path-to-links.jsonYou're welcome to submit PRs if you find things that can be fixed/improved!