You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To run the container after pulling the image from the GitHub Container Registry, use:
315
320
```sh
316
321
sudo docker run -d \
317
322
--name ps-printer-app \
318
323
--network host \
319
324
-e PORT=<port> \
325
+
-v ps-printer-app:/var/lib/ps-printer-app \
326
+
-v /dev/bus/usb:/dev/bus/usb:ro \
327
+
--device-cgroup-rule='c 189:* rmw' \
320
328
ghcr.io/openprinting/ps-printer-app:latest
321
329
```
322
330
@@ -326,18 +334,30 @@ Alternatively, you can pull the image from Docker Hub, by running:
326
334
sudo docker pull openprinting/ps-printer-app
327
335
```
328
336
337
+
Create a Docker volume:
338
+
```sh
339
+
sudo docker volume create ps-printer-app
340
+
```
341
+
329
342
To run the container after pulling the image from Docker Hub, use:
330
343
```sh
331
344
sudo docker run -d \
332
345
--name ps-printer-app \
333
346
--network host \
334
347
-e PORT=<port> \
348
+
-v ps-printer-app:/var/lib/ps-printer-app \
349
+
-v /dev/bus/usb:/dev/bus/usb:ro \
350
+
--device-cgroup-rule='c 189:* rmw' \
335
351
openprinting/ps-printer-app:latest
336
352
```
337
353
338
354
-`PORT` is an optional environment variable used to start the printer-app on a specified port. If not provided, it will start on the default port 8000 or, if port 8000 is busy, on 8001 and so on.
339
355
-**The container must be started in `--network host` mode** to allow the Printer-Application instance inside the container to access and discover printers available in the local network where the host system is in.
340
356
- Alternatively using the internal network of the Docker instance (`-p <port>:8000` instead of `--network host -e PORT=<port>`) only gives access to local printers running on the host system itself.
357
+
-`-v ps-printer-app:/var/lib/ps-printer-app` maps a volume for persistent storage.
358
+
- The following volume and device settings are crucial for USB printer access:
359
+
-`-v /dev/bus/usb:/dev/bus/usb:ro` mounts the host's USB device directory read-only inside the container for USB printer access.
360
+
-`--device-cgroup-rule='c 189:* rmw'` allows the container to read, write, and mknod to USB devices.
341
361
342
362
### Setting up and running a ps-printer-app container locally
343
363
@@ -373,18 +393,30 @@ Once the rock is built, you need to compile a docker image from it:
-`PORT` is an optional environment variable used to start the printer-app on a specified port. If not provided, it will start on the default port 8000 or, if port 8000 is busy, on 8001 and so on.
386
414
-**The container must be started in `--network host` mode** to allow the Printer-Application instance inside the container to access and discover printers available in the local network where the host system is in.
387
415
- Alternatively using the internal network of the Docker instance (`-p <port>:8000` instead of `--network host -e PORT=<port>`) only gives access to local printers running on the host system itself.
416
+
-`-v ps-printer-app:/var/lib/ps-printer-app` maps a volume for persistent storage.
417
+
- The following volume and device settings are crucial for USB printer access:
418
+
-`-v /dev/bus/usb:/dev/bus/usb:ro` mounts the host's USB device directory read-only inside the container for USB printer access.
419
+
-`--device-cgroup-rule='c 189:* rmw'` allows the container to read, write, and mknod to USB devices.
0 commit comments