Make docs/schema a little more container agnostic / less Docker specific.

This commit is contained in:
Dan Helfman 2023-04-16 15:41:17 -07:00
parent 991e08f16d
commit 9f5769f87b
4 changed files with 27 additions and 24 deletions

View file

@ -836,25 +836,25 @@ properties:
Command to use instead of "pg_dump" or Command to use instead of "pg_dump" or
"pg_dumpall". This can be used to run a specific "pg_dumpall". This can be used to run a specific
pg_dump version (e.g., one inside a running pg_dump version (e.g., one inside a running
docker container). Defaults to "pg_dump" for container). Defaults to "pg_dump" for single
single database dump or "pg_dumpall" to dump database dump or "pg_dumpall" to dump all
all databases. databases.
example: docker exec my_pg_container pg_dump example: docker exec my_pg_container pg_dump
pg_restore_command: pg_restore_command:
type: string type: string
description: | description: |
Command to use instead of "pg_restore". This Command to use instead of "pg_restore". This
can be used to run a specific pg_restore can be used to run a specific pg_restore
version (e.g., one inside a running docker version (e.g., one inside a running container).
container). Defaults to "pg_restore". Defaults to "pg_restore".
example: docker exec my_pg_container pg_restore example: docker exec my_pg_container pg_restore
psql_command: psql_command:
type: string type: string
description: | description: |
Command to use instead of "psql". This can be Command to use instead of "psql". This can be
used to run a specific psql version (e.g., used to run a specific psql version (e.g.,
one inside a running docker container). one inside a running container). Defaults to
Defaults to "psql". "psql".
example: docker exec my_pg_container psql example: docker exec my_pg_container psql
options: options:
type: string type: string

View file

@ -138,7 +138,7 @@ hooks:
### Containers ### Containers
If your database is running within a Docker container and borgmatic is too, no If your database is running within a container and borgmatic is too, no
problem—simply configure borgmatic to connect to the container's name on its problem—simply configure borgmatic to connect to the container's name on its
exposed port. For instance: exposed port. For instance:
@ -154,10 +154,10 @@ hooks:
But what if borgmatic is running on the host? You can still connect to a But what if borgmatic is running on the host? You can still connect to a
database container if its ports are properly exposed to the host. For database container if its ports are properly exposed to the host. For
instance, when running the database container with Docker, you can specify instance, when running the database container, you can specify `--publish
`--publish 127.0.0.1:5433:5432` so that it exposes the container's port 5432 127.0.0.1:5433:5432` so that it exposes the container's port 5432 to port 5433
to port 5433 on the host (only reachable on localhost, in this case). Or the on the host (only reachable on localhost, in this case). Or the same thing
same thing with Docker Compose: with Docker Compose:
```yaml ```yaml
services: services:

View file

@ -87,19 +87,20 @@ tox -e codespell
borgmatic additionally includes some end-to-end tests that integration test borgmatic additionally includes some end-to-end tests that integration test
with Borg and supported databases for a few representative scenarios. These with Borg and supported databases for a few representative scenarios. These
tests don't run by default when running `tox`, because they're relatively slow tests don't run by default when running `tox`, because they're relatively slow
and depend on Docker containers for runtime dependencies. These tests tests do and depend on containers for runtime dependencies. These tests do run on the
run on the continuous integration (CI) server, and running them on your continuous integration (CI) server, and running them on your developer machine
developer machine is the closest thing to CI test parity. is the closest thing to CI-test parity.
If you would like to run the full test suite, first install Docker and [Docker If you would like to run the full test suite, first install Docker (or Podman;
Compose](https://docs.docker.com/compose/install/). Then run: see below) and [Docker Compose](https://docs.docker.com/compose/install/).
Then run:
```bash ```bash
scripts/run-end-to-end-dev-tests scripts/run-end-to-end-dev-tests
``` ```
Note that this scripts assumes you have permission to run Docker. If you This script assumes you have permission to run `docker`. If you don't, then
don't, then you may need to run with `sudo`. you may need to run with `sudo`.
#### Podman #### Podman
@ -119,6 +120,7 @@ some key points to double-check:
* Create a non-root Podman socket for that user: * Create a non-root Podman socket for that user:
```bash ```bash
systemctl --user enable --now podman.socket systemctl --user enable --now podman.socket
systemctl --user start --now podman.socket
``` ```
Then you'll be able to run end-to-end tests as per normal, and the test script Then you'll be able to run end-to-end tests as per normal, and the test script
@ -161,11 +163,12 @@ To build and view a copy of the documentation with your local changes, run the
following from the root of borgmatic's source code: following from the root of borgmatic's source code:
```bash ```bash
sudo scripts/dev-docs scripts/dev-docs
``` ```
This requires Docker to be installed on your system. You may not need to use This requires Docker (or Podman; see below) to be installed on your system.
sudo if your non-root user has permissions to run Docker. This script assumes you have permission to run `docker`. If you don't, then
you may need to run with `sudo`.
After you run the script, you can point your web browser at After you run the script, you can point your web browser at
http://localhost:8080 to view the documentation with your changes. http://localhost:8080 to view the documentation with your changes.

View file

@ -82,8 +82,8 @@ on a relatively dedicated system, then a global install can work out fine.
Besides the approaches described above, there are several other options for Besides the approaches described above, there are several other options for
installing borgmatic: installing borgmatic:
* [Docker image with scheduled backups](https://hub.docker.com/r/b3vis/borgmatic/) (+ Docker Compose files) * [container image with scheduled backups](https://hub.docker.com/r/b3vis/borgmatic/) (+ Docker Compose files)
* [Docker image with multi-arch and Docker CLI support](https://hub.docker.com/r/modem7/borgmatic-docker/) * [container image with multi-arch and Docker CLI support](https://hub.docker.com/r/modem7/borgmatic-docker/)
* [Debian](https://tracker.debian.org/pkg/borgmatic) * [Debian](https://tracker.debian.org/pkg/borgmatic)
* [Ubuntu](https://launchpad.net/ubuntu/+source/borgmatic) * [Ubuntu](https://launchpad.net/ubuntu/+source/borgmatic)
* [Fedora official](https://bodhi.fedoraproject.org/updates/?search=borgmatic) * [Fedora official](https://bodhi.fedoraproject.org/updates/?search=borgmatic)