Browse Source

Switch to Docker Compose for dev-docs script, so podman-docker is no longer needed for Podman users.

Dan Helfman 2 years ago
parent
commit
22b84a2fea
3 changed files with 31 additions and 8 deletions
  1. 22 0
      docs/docker-compose.yaml
  2. 2 3
      docs/how-to/develop-on-borgmatic.md
  3. 7 5
      scripts/dev-docs

+ 22 - 0
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

+ 2 - 3
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
 Setting up Podman is outside the scope of this documentation, but here are
 some key points to double-check:
 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
  * Configure `/etc/subuid` and `/etc/subgid` to map users/groups for the
    non-root user who will run tests.
    non-root user who will run tests.
  * Create a non-root Podman socket for that user:
  * 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.
 [Podman](https://podman.io/) instead of Docker.
 
 
 Setting up Podman is outside the scope of this documentation. But once you
 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.
 Podman instead of Docker.

+ 7 - 5
scripts/dev-docs

@@ -2,8 +2,10 @@
 
 
 set -e
 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