Normalize Docker Compose one-shot commands

This commit is contained in:
Nick Sweeting 2026-08-11 10:45:06 -07:00
parent f9f2a9684d
commit 38e40a7730
No known key found for this signature in database
8 changed files with 17 additions and 17 deletions

View File

@ -698,7 +698,7 @@ echo 'any text with <a href="https://example.com">urls</a> in it' | archivebox a
# if using Docker, add -i when piping stdin:
# echo 'https://example.com' | docker run -v $PWD:/data -i archivebox/archivebox:dev add
# if using Docker Compose, add -T when piping stdin / stdout:
# echo 'https://example.com' | docker compose run -T archivebox add
# echo 'https://example.com' | docker compose run --rm -T archivebox add
```
See the [Usage: CLI](https://github.com/ArchiveBox/ArchiveBox/wiki/Usage#CLI-Usage) page for documentation and examples.
@ -925,7 +925,7 @@ archivebox list --json --with-headers > index.json # export to json blob
archivebox list --csv=timestamp,url,title > index.csv # export to csv spreadsheet
# (if using Docker Compose, add the -T flag when piping)
# docker compose run -T archivebox list --html 'https://example.com' > index.html
# docker compose run --rm -T archivebox list --html 'https://example.com' > index.html
</code></pre>
The paths in the static exports are relative, make sure to keep them next to your `./archive` folder when backing them up or viewing them.

View File

@ -2,13 +2,13 @@
# mkdir -p ~/archivebox/data && cd ~/archivebox
# curl -fsSL 'https://docker-compose.archivebox.io' > docker-compose.yml
# docker compose pull
# docker compose run archivebox init
# docker compose run archivebox install
# docker compose run --rm archivebox init
# docker compose run --rm archivebox install
# docker compose up -d && open 'http://admin.archivebox.localhost:8000'
# docker compose run archivebox add --depth=1 'https://news.ycombinator.com'
# docker compose run -T archivebox add < ~/Downloads/bookmarks.txt
# docker compose run archivebox help
# docker compose run --rm archivebox add --depth=1 'https://news.ycombinator.com'
# docker compose run --rm -T archivebox add < ~/Downloads/bookmarks.txt
# docker compose run --rm archivebox help
# Documentation:
# https://github.com/ArchiveBox/ArchiveBox/wiki/Docker#docker-compose
@ -43,14 +43,14 @@ services:
### `archivebox server` now runs the orchestrator itself, so scheduled crawls and queued UI/API jobs
# are processed by the main container without needing a separate scheduler sidecar. To add a new job:
# $ docker compose run archivebox schedule --add --every=day --depth=1 'https://example.com/some/rss/feed.xml'
# $ docker compose run --rm archivebox schedule --add --every=day --depth=1 'https://example.com/some/rss/feed.xml'
# the running server orchestrator will pick it up automatically at the next due time.
# https://github.com/ArchiveBox/ArchiveBox/wiki/Scheduled-Archiving
### ArchiveBox now starts and uses Sonic automatically when SEARCH_BACKEND_ENGINE=sonic.
# If Sonic is ever started after not running for a while, update its full-text index by running:
# $ docker compose run archivebox update --index-only
# $ docker compose run --rm archivebox update --index-only
# https://github.com/ArchiveBox/ArchiveBox/wiki/Setting-up-Search

View File

@ -73,8 +73,8 @@ docker compose up -d novnc
3. Start ArchiveBox's Chrome inside Docker
```bash
docker compose run archivebox persona create personal
docker compose run archivebox /data/lib/env/bin/chromium --user-data-dir=/data/personas/personal/chrome_profile --profile-directory=Default --disable-gpu --disable-features=dbus --disable-dev-shm-usage --start-maximized --no-sandbox --disable-setuid-sandbox --no-zygote --disable-sync --no-first-run
docker compose run --rm archivebox persona create personal
docker compose run --rm archivebox /data/lib/env/bin/chromium --user-data-dir=/data/personas/personal/chrome_profile --profile-directory=Default --disable-gpu --disable-features=dbus --disable-dev-shm-usage --start-maximized --no-sandbox --disable-setuid-sandbox --no-zygote --disable-sync --no-first-run
```
<small>(make sure you set `DISPLAY` and keep the normal persistent `/data` volume from the Compose setup!)</small>
@ -89,7 +89,7 @@ docker compose down --remove-orphans
# edit docker-compose.yml to remove/comment out the novnc: section
# test it all out by archiving something hosted on one of the domains you logged in to
docker compose run archivebox add --persona=personal 'https://private.example.com/some/site/requiring/login.html'
docker compose run --rm archivebox add --persona=personal 'https://private.example.com/some/site/requiring/login.html'
# check the SingleFile, Screenshot, DOM, or PDF snapshot output (only these use the Chrome profile)
# make sure the content appears as your logged-in user would see it
```

View File

@ -49,7 +49,7 @@ archivebox add < your_urls.txt
docker run -v $PWD:/data -i archivebox/archivebox:dev add < your_urls.txt
# or if using Docker Compose
docker compose run -T archivebox add < your_urls.txt
docker compose run --rm -T archivebox add < your_urls.txt
# any text containing URLs can ingested via stdin or as args
curl -fsSL 'https://getpocket.com/users/YOURUSERNAME/feed/all' | archivebox add

View File

@ -105,7 +105,7 @@ More info:
<img src="https://imgur.zervice.io/yDqJc4I.jpg" width="150px" align="right"/>
> [!NOTE]
> Use `docker compose run archivebox ...` for normal one-shot CLI commands. `docker compose exec archivebox ...` is also supported against a running container; if it starts as root, ArchiveBox drops to the dedicated `archivebox` account before operating on the collection.
> Use `docker compose run --rm archivebox ...` for normal one-shot CLI commands. `docker compose exec archivebox ...` is also supported against a running container; if it starts as root, ArchiveBox drops to the dedicated `archivebox` account before operating on the collection.
ArchiveBox drops privileges to the collection owner when it starts as root and can do so safely, including in the official Docker image. Do not bypass that boundary or force runtime dependencies to stay privileged:
- Browser sandboxing cannot provide its normal protection when the browser itself runs as root

View File

@ -39,7 +39,7 @@ You need a user account to access the Admin UI, you can run the commands below t
archivebox manage createsuperuser
archivebox manage changepassword <username>
# equivalent: docker compose run archivebox manage [...]
# equivalent: docker compose run --rm archivebox manage [...]
# equivalent: docker run -v $PWD:/data archivebox/archivebox:dev manage [...]
```

View File

@ -131,7 +131,7 @@ archivebox update --index-only
archivebox search 'some text to search'
```
Run the same commands as `docker compose run archivebox ...` when using Docker Compose.
Run the same commands as `docker compose run --rm archivebox ...` when using Docker Compose.
*Fore more detailed instructions [see here](https://github.com/ArchiveBox/ArchiveBox/issues/956#issuecomment-1320587158)...*

View File

@ -29,7 +29,7 @@ All three of these ways of running ArchiveBox are equivalent and interchangeable
*Using the Python package via the current `uv` instructions in [[Install]]*
- `docker run ... archivebox/archivebox [subcommand] [...args]`
*Using the official Docker image*
- `docker compose run archivebox [subcommand] [...args]`
- `docker compose run --rm archivebox [subcommand] [...args]`
*Using the official Docker image w/ Docker Compose*
You can share a single archivebox data directory between Docker and non-Docker instances as well, allowing you to run the server in a container but still execute CLI commands on the host for example.