Make the container image actually clone (issue #7)
Two failures stopped a docker run from producing anything. Chrome aborted on launch with 'chrome_crashpad_handler: --database is required', because its crash reporter cannot start in a minimal container, so disable the crash reporter on the container launch path. kage never uploads Chrome crash dumps, so nothing is lost. The image also created the kage user without a home directory, so HOME was an unwritable /home/kage. kage writes its default output and resume state under $HOME/data/kage and Chrome puts its profile and crash database under HOME too, so both failed with a permission error and the mounted /out volume captured nothing. Point HOME at the /out volume so all of it lands somewhere writable that the mount picks up.
This commit is contained in:
@@ -19,6 +19,10 @@ All notable changes to kage are recorded here. The format follows
|
||||
|
||||
- Clearer crawl error reporting. Each failure is logged with a classified reason (`HTTP 403 Forbidden`, `timed out`, ...), the URL, and the page that referenced it, and the end-of-run summary lists what went wrong instead of printing only a count.
|
||||
|
||||
### Fixed
|
||||
|
||||
- The container image now runs. Chrome aborted on launch with `chrome_crashpad_handler: --database is required`, so kage disables Chrome's crash reporter inside a container, and the `kage` user now has a writable home (the mounted `/out` volume) so the default output, resume state, and Chrome's profile no longer fail with a permission error (issue #7).
|
||||
|
||||
## [0.1.1] - 2026-06-14
|
||||
|
||||
### Added
|
||||
|
||||
+8
-1
@@ -29,7 +29,14 @@ WORKDIR /out
|
||||
# Point kage at the bundled Chromium and write mirrors under /out by default:
|
||||
#
|
||||
# docker run -v "$PWD/out:/out" ghcr.io/tamnd/kage clone example.com
|
||||
ENV KAGE_CHROME=/usr/bin/chromium-browser
|
||||
#
|
||||
# The kage user has no home directory of its own, so HOME points at the mounted
|
||||
# /out volume. That keeps two things writable: kage's default output and resume
|
||||
# state (it lands under $HOME/data/kage), and Chrome's profile and crash
|
||||
# database. Without this both fail with a permission error in the container
|
||||
# (issue #7), and the mounted volume captures nothing.
|
||||
ENV KAGE_CHROME=/usr/bin/chromium-browser \
|
||||
HOME=/out
|
||||
|
||||
VOLUME ["/out"]
|
||||
|
||||
|
||||
+6
-1
@@ -146,8 +146,13 @@ func (p *Pool) getBrowser() (*rod.Browser, error) {
|
||||
// In a container, the default /dev/shm is only 64 MB, too small for
|
||||
// Chrome's renderer on large pages, so steer it to a temp file instead.
|
||||
// Outside a container /dev/shm is roomy and faster, so leave it alone.
|
||||
// Chrome's crashpad handler also aborts with "--database is required" in a
|
||||
// minimal container, which fails the whole launch (issue #7), so turn the
|
||||
// crash reporter off there. kage never uploads Chrome crash dumps anyway.
|
||||
if inContainer() {
|
||||
l = l.Set("disable-dev-shm-usage", "")
|
||||
l = l.Set("disable-dev-shm-usage", "").
|
||||
Set("disable-crash-reporter", "").
|
||||
Set("disable-breakpad", "")
|
||||
}
|
||||
|
||||
if bin := p.chromeBin(); bin != "" {
|
||||
|
||||
Reference in New Issue
Block a user