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
Introduces immutability to OCI image by running everything as non-root user _daemon_; Updated README to include runtime flags for data persistence and USB printer access
To run the container after pulling the image from the GitHub Container Registry, use:
270
275
```sh
271
276
sudo docker run -d \
272
277
--name hplip-printer-app \
273
278
--network host \
274
279
-e PORT=<port> \
280
+
-v hplip-printer-app:/var/lib/hplip-printer-app \
281
+
-v /dev/bus/usb:/dev/bus/usb:ro \
282
+
--device-cgroup-rule='c 189:* rmw' \
275
283
ghcr.io/openprinting/hplip-printer-app:latest
276
284
```
277
285
@@ -281,18 +289,30 @@ Alternatively, you can pull the image from Docker Hub, by running:
281
289
sudo docker pull openprinting/hplip-printer-app
282
290
```
283
291
292
+
Create a Docker volume:
293
+
```sh
294
+
sudo docker volume create hplip-printer-app
295
+
```
296
+
284
297
To run the container after pulling the image from Docker Hub, use:
285
298
```sh
286
299
sudo docker run -d \
287
300
--name hplip-printer-app \
288
301
--network host \
289
302
-e PORT=<port> \
303
+
-v hplip-printer-app:/var/lib/hplip-printer-app \
304
+
-v /dev/bus/usb:/dev/bus/usb:ro \
305
+
--device-cgroup-rule='c 189:* rmw' \
290
306
openprinting/hplip-printer-app:latest
291
307
```
292
308
293
309
-`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.
294
310
-**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.
295
311
- 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.
312
+
-`-v hplip-printer-app:/var/lib/hplip-printer-app` maps a volume for persistent storage.
313
+
- The following volume and device settings are crucial for USB printer access:
314
+
-`-v /dev/bus/usb:/dev/bus/usb:ro` mounts the host's USB device directory read-only inside the container for USB printer access.
315
+
-`--device-cgroup-rule='c 189:* rmw'` allows the container to read, write, and mknod to USB devices.
296
316
297
317
### Setting Up and Running hplip-printer-app locally
298
318
@@ -330,18 +350,30 @@ Once the rock is built, you need to compile 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.
343
371
-**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.
344
372
- 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.
373
+
-`-v hplip-printer-app:/var/lib/hplip-printer-app` maps a volume for persistent storage.
374
+
- The following volume and device settings are crucial for USB printer access:
375
+
-`-v /dev/bus/usb:/dev/bus/usb:ro` mounts the host's USB device directory read-only inside the container for USB printer access.
376
+
-`--device-cgroup-rule='c 189:* rmw'` allows the container to read, write, and mknod to USB devices.
0 commit comments