From 22b84a2feaad01fe2a80e46e01c177e61bc80f8f Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sat, 22 Apr 2023 10:07:40 -0700 Subject: [PATCH] Switch to Docker Compose for dev-docs script, so podman-docker is no longer needed for Podman users. --- docs/docker-compose.yaml | 22 ++++++++++++++++++++++ docs/how-to/develop-on-borgmatic.md | 5 ++--- scripts/dev-docs | 12 +++++++----- 3 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 docs/docker-compose.yaml diff --git a/docs/docker-compose.yaml b/docs/docker-compose.yaml new file mode 100644 index 0000000..e854c13 --- /dev/null +++ b/docs/docker-compose.yaml @@ -0,0 +1,22 @@ +version: '3' +services: + docs: + image: borgmatic-docs + container_name: docs + ports: + - 8080:80 + build: + dockerfile: docs/Dockerfile + context: .. + args: + ENVIRONMENT: dev + message: + image: alpine + container_name: message + command: + - sh + - -c + - | + echo "You can view dev docs at http://localhost:8080" + depends_on: + - docs diff --git a/docs/how-to/develop-on-borgmatic.md b/docs/how-to/develop-on-borgmatic.md index 6d2b13b..391d795 100644 --- a/docs/how-to/develop-on-borgmatic.md +++ b/docs/how-to/develop-on-borgmatic.md @@ -113,8 +113,7 @@ borgmatic's end-to-end tests optionally support using Setting up Podman is outside the scope of this documentation, but here are some key points to double-check: - * Install Podman along with `podman-docker` and your desired networking - support. + * Install Podman and your desired networking support. * Configure `/etc/subuid` and `/etc/subgid` to map users/groups for the non-root user who will run tests. * Create a non-root Podman socket for that user: @@ -186,5 +185,5 @@ borgmatic's developer build for documentation optionally supports using [Podman](https://podman.io/) instead of Docker. Setting up Podman is outside the scope of this documentation. But once you -install `podman-docker`, then `scripts/dev-docs` should automatically use +install and configure Podman, then `scripts/dev-docs` should automatically use Podman instead of Docker. diff --git a/scripts/dev-docs b/scripts/dev-docs index 1ecc7e4..866ae0e 100755 --- a/scripts/dev-docs +++ b/scripts/dev-docs @@ -2,8 +2,10 @@ set -e -docker build --tag borgmatic-docs --build-arg ENVIRONMENT=dev --file docs/Dockerfile . -echo -echo "You can view dev docs at http://localhost:8080" -echo -docker run --interactive --tty --publish 8080:80 --rm borgmatic-docs +USER_PODMAN_SOCKET_PATH=/run/user/$UID/podman/podman.sock + +if [ -e "$USER_PODMAN_SOCKET_PATH" ]; then + export DOCKER_HOST="unix://$USER_PODMAN_SOCKET_PATH" +fi + +docker-compose --file docs/docker-compose.yaml up --build --force-recreate