[GH-ISSUE #62] Simple docker container for bookmark-archiver #3062

Closed
opened 2026-03-14 20:50:25 +03:00 by kerem · 7 comments
Owner

Originally created by @pirate on GitHub (Jan 10, 2018).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/62

Once the backend/proxy portion is done, many people have asked for a docker container to run it.

Originally created by @pirate on GitHub (Jan 10, 2018). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/62 Once the backend/proxy portion is done, many people have asked for a docker container to run it.
kerem 2026-03-14 20:50:25 +03:00
Author
Owner

@aurelg commented on GitHub (Aug 29, 2018):

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?

<!-- gh-comment-id:417073254 --> @aurelg commented on GitHub (Aug 29, 2018): 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`?
Author
Owner

@pirate commented on GitHub (Aug 29, 2018):

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?

<!-- gh-comment-id:417138372 --> @pirate commented on GitHub (Aug 29, 2018): 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?
Author
Owner

@aurelg commented on GitHub (Aug 30, 2018):

I haven't fixed the bug yet, but hacked my own version: linkbak.

<!-- gh-comment-id:417396485 --> @aurelg commented on GitHub (Aug 30, 2018): I haven't fixed the bug yet, but hacked my own version: [linkbak](https://github.com/aurelg/linkbak).
Author
Owner

@aurelg commented on GitHub (Sep 1, 2018):

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.

<!-- gh-comment-id:417864095 --> @aurelg commented on GitHub (Sep 1, 2018): Bug fixed on [linkbak](https://github.com/aurelg/linkbak/), here's [the relevant Dockerfile](https://github.com/aurelg/linkbak/blob/master/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.
Author
Owner

@pirate commented on GitHub (Oct 14, 2018):

I've now added a Dockerfile on master that works. A docker-compose.yml example with nginx to server the archive will come next.

<!-- gh-comment-id:429667622 --> @pirate commented on GitHub (Oct 14, 2018): I've now added a Dockerfile on master that works. A docker-compose.yml example with nginx to server the archive will come next.
Author
Owner

@pirate commented on GitHub (Oct 15, 2018):

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!

<!-- gh-comment-id:429684891 --> @pirate commented on GitHub (Oct 15, 2018): CC: @hannah98 @ivar @ilvar @Strubbl @aurelg You can use the new official docker image for Bookmark Archiver like so: ```bash 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!
Author
Owner

@pirate commented on GitHub (Jan 30, 2019):

Closing this because it's been released and working fairly well for a while now: https://github.com/pirate/ArchiveBox/wiki/Docker

<!-- gh-comment-id:458871431 --> @pirate commented on GitHub (Jan 30, 2019): Closing this because it's been released and working fairly well for a while now: https://github.com/pirate/ArchiveBox/wiki/Docker
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#3062
No description provided.