[GH-ISSUE #633] Question: How to run ArchiveBox under Docker as non-root. #3413

Closed
opened 2026-03-14 22:44:53 +03:00 by kerem · 4 comments
Owner

Originally created by @thprice on GitHub (Jan 25, 2021).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/633

Actually, I run it on Kubernetes, not plain Docker (or, rather, try to run it).

When trying to initialise the archive (database etc.) using
archivebox init
it fails with:
[!] ArchiveBox should never be run as root!

When running the container as another user than root, it complains that it either doesn't know the user id or fails with:
error: failed switching to "archivebox": operation not permitted

Any ideas?

Originally created by @thprice on GitHub (Jan 25, 2021). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/633 Actually, I run it on Kubernetes, not plain Docker (or, rather, try to run it). When trying to initialise the archive (database etc.) using `archivebox init` it fails with: `[!] ArchiveBox should never be run as root!` When running the container as another user than root, it complains that it either doesn't know the user id or fails with: `error: failed switching to "archivebox": operation not permitted` Any ideas?
kerem closed this issue 2026-03-14 22:44:58 +03:00
Author
Owner

@pirate commented on GitHub (Jan 25, 2021):

I think this is the same issue as here: https://github.com/ArchiveBox/ArchiveBox/issues/539

You can try some of the workarounds others have posted in that thread, or just subscribe and stay tuned for when a fix is pushed.

This only happens in some specific docker scenarios and I think you were unlucky enough to hit one of them. Hopefully we'll have a fix out soon, but I can't promise it'll be this week.

<!-- gh-comment-id:767158036 --> @pirate commented on GitHub (Jan 25, 2021): I think this is the same issue as here: https://github.com/ArchiveBox/ArchiveBox/issues/539 You can try some of the workarounds others have posted in that thread, or just subscribe and stay tuned for when a fix is pushed. This only happens in some specific docker scenarios and I think you were unlucky enough to hit one of them. Hopefully we'll have a fix out soon, but I can't promise it'll be this week.
Author
Owner

@thprice commented on GitHub (Jan 28, 2021):

Thanks for your response. It may be the same issue but I'm not sure. #539 is about file system access problems while this here seems to be about errors switching the uid.

No need for a reopen, though. I'll wait for the fix and try again. Maybe, I'll come back then. :-)

<!-- gh-comment-id:769421079 --> @thprice commented on GitHub (Jan 28, 2021): Thanks for your response. It may be the same issue but I'm not sure. #539 is about file system access problems while this here seems to be about errors switching the uid. No need for a reopen, though. I'll wait for the fix and try again. Maybe, I'll come back then. :-)
Author
Owner

@pirate commented on GitHub (Jan 28, 2021):

The fix for UID/GID switching issues is the same fix as the one for #539 (I think), it's actually already on dev if you want to try it.

git clone --recurse-submodules -b dev https://github.com/ArchiveBox/ArchiveBox
cd ArchiveBox
docker build . -t archivebox

docker run -v $PWD:/data -it archivebox ...
<!-- gh-comment-id:769462720 --> @pirate commented on GitHub (Jan 28, 2021): The fix for UID/GID switching issues is the same fix as the one for #539 (I think), it's actually already on `dev` if you want to try it. ```bash git clone --recurse-submodules -b dev https://github.com/ArchiveBox/ArchiveBox cd ArchiveBox docker build . -t archivebox docker run -v $PWD:/data -it archivebox ... ```
Author
Owner

@thprice commented on GitHub (Jan 29, 2021):

Thanks for the fix. It can confirm that it works (at least for me :-))

<!-- gh-comment-id:769591596 --> @thprice commented on GitHub (Jan 29, 2021): Thanks for the fix. It can confirm that it works (at least for me :-))
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#3413
No description provided.