{"id":13585468,"url":"https://github.com/RagingTiger/cups-airprint","last_synced_at":"2025-04-07T09:34:47.350Z","repository":{"id":44486418,"uuid":"195895826","full_name":"RagingTiger/cups-airprint","owner":"RagingTiger","description":"Dockerized CUPS/AirPrint","archived":true,"fork":false,"pushed_at":"2022-07-11T13:49:18.000Z","size":37,"stargazers_count":28,"open_issues_count":0,"forks_count":45,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-02T16:00:46.067Z","etag":null,"topics":["airprint","cups","cups-docker","docker","docker-image","docker-volumes","multiarch","printer","printers","usb-printers"],"latest_commit_sha":null,"homepage":"https://ghcr.io/ragingtiger/cups-airprint:master","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RagingTiger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-08T22:46:47.000Z","updated_at":"2024-06-30T03:37:51.000Z","dependencies_parsed_at":"2022-08-31T09:51:43.002Z","dependency_job_id":null,"html_url":"https://github.com/RagingTiger/cups-airprint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RagingTiger%2Fcups-airprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RagingTiger%2Fcups-airprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RagingTiger%2Fcups-airprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RagingTiger%2Fcups-airprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RagingTiger","download_url":"https://codeload.github.com/RagingTiger/cups-airprint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223277887,"owners_count":17118666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airprint","cups","cups-docker","docker","docker-image","docker-volumes","multiarch","printer","printers","usb-printers"],"created_at":"2024-08-01T15:04:57.658Z","updated_at":"2024-11-06T03:31:12.120Z","avatar_url":"https://github.com/RagingTiger.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Archived\nNo further updates to the repository will be made at this time. Please see the _forks_ for any possible solutions to your specific use case and/or the \nauthor-suggested repo at: https://github.com/chuckcharlie/cups-avahi-airprint.\n\n# \u003ca name=\"toc\"\u003e\u003c/a\u003e Table of Contents\n* [About](#about)\n* [Intro](#intro)\n* [Multi-arch Image](#multi-arch)\n* [Getting Started](#start)\n  + [Docker Run](#drun)\n  + [Docker Create](#dcreate)\n    + [Parameters](#dparams)\n  + [Docker Compose](#dcompose)\n  + [Docker Build](#dbuild)\n* [Using](#using)\n* [Notes](#notes)\n* [Trouble Shooting](#trouble)\n  + [Missing Printer Driver](#missing-driver)\n  + [Driver Version](#driver-version)\n\n\n# \u003ca name=\"about\"\u003e\u003c/a\u003e [About](#toc)\nModified copy of source code at:\nhttps://github.com/quadportnick/docker-cups-airprint\n\n# \u003ca name=\"intro\"\u003e\u003c/a\u003e [Intro](#toc)\nThis Ubuntu-based Docker image runs a CUPS instance that is meant as an AirPrint\nrelay for printers that are already on the network but not AirPrint capable.\nThe local Avahi will be utilized for advertising the printers on the network.\n\n# \u003ca name=\"multi-arch\"\u003e\u003c/a\u003e [Multi-arch Image](#toc)\nThe below commands reference a\n[Docker Manifest List](https://docs.docker.com/engine/reference/commandline/manifest/)\nat [`ghcr.io/ragingtiger/cups-airprint:master`](https://github.com/ragingtiger/cups-airprint/pkgs/container/cups-airprint)\nbuilt using Docker's\n[BuildKit](https://docs.docker.com/develop/develop-images/build_enhancements/).\nSimply running commands using this image will pull\nthe matching image architecture (e.g. `amd64`, `arm32v7`, or `arm64`) based on\nthe hosts architecture. Hence, if you are on a **Raspberry Pi** the below\ncommands will work the same as if you were on a traditional `amd64`\ndesktop/laptop computer. **Note**: Because the image requires `ubuntu` as its base\nimage, there is currently no `arm32v6` architecture available. This means if your\ntarget hardware is a **Raspberry Pi Zero** or similar `arm 6` architecture, this\nimage will not run.\n\n# \u003ca name=\"start\"\u003e\u003c/a\u003e [Getting Started](#toc)\nThis section will give an overview of the essential options/arguments to pass\nto docker to successfully run containers from the `ghcr.io/ragingtiger/cups-airprint:master`\ndocker image.\n\n## \u003ca name=\"drun\"\u003e\u003c/a\u003e [Docker Run](#toc)\nTo simply do a quick and dirty run of the cups/airprint container:\n```\ndocker run \\\n       -d \\\n       --name=cups \\\n       --net=host \\\n       -v /var/run/dbus:/var/run/dbus \\\n       --device /dev/bus \\\n       --device /dev/usb \\\n       -e CUPSADMIN=\"admin\" \\\n       -e CUPSPASSWORD=\"password\" \\\n       ghcr.io/ragingtiger/cups-airprint:master\n```\nTo stop the container simply run:\n```\ndocker stop cups\n```\nTo remove the conainer simply run:\n```\ndocker rm cups\n```\n**WARNING**: Be aware that deleting the container (i.e. `cups` in the example)\nwill permanently delete the data that `docker volume` is storing for you.\nIf you want to permanently persist this data, see the `docker create` example\n[below](#create). Continue reading the *Notes* section for more details about\nDocker volumes\n\n+ **Notes**: The `Dockerfile` explicitly sets volumes at `/config` and\n`/services` (see\n[these lines](https://github.com/RagingTiger/docker-cups-airprint/blob/2a30b6690a08262fb64375b74f07ab7b3f77ec4a/Dockerfile#L16-L17)).\n The necessary configurations done by the `docker container` will be\nstored in those directories and will persist even if the container stops. Docker\nwill store the contents of these directories (located in the container) in\n`/var/lib/docker/volumes` (see for reference\n[Docker Volumes](https://docs.docker.com/storage/volumes/)).\n\n## \u003ca name=\"dcreate\"\u003e\u003c/a\u003e [Docker Create](#toc)\nCreating a container is often more desirable than directly running it:\n```\ndocker create \\\n       --name=cups \\\n       --restart=always \\\n       --net=host \\\n       -v /var/run/dbus:/var/run/dbus \\\n       -v ~/airprint_data/config:/config \\\n       -v ~/airprint_data/services:/services \\\n       --device /dev/bus \\\n       --device /dev/usb \\\n       -e CUPSADMIN=\"admin\" \\\n       -e CUPSPASSWORD=\"password\" \\\n       ghcr.io/ragingtiger/cups-airprint:master\n```\nFollow this with `docker start` and your cups/airprint printer is running:\n```\ndocker start cups\n```\nTo stop the container simply run:\n```\ndocker stop cups\n```\nTo remove the conainer simply run:\n```\ndocker rm cups\n```\n\n+ **Notes**: As mentioned in the *Notes* subsection of the [Run](#run) section,\nthe `Dockerfile` explicitly declares two volumes at `/config` and `/services`\ninside the container as mount points. Here we actually override the default\nuse of Docker's innate volume management system and declare our own path on the\nhost system to mount the two directories `/config` and `/services`. Why? Because\nnow if the container is deleted (for any number of reason ...) the data will\npersist. Here we chose to mount the internal `/config` and `/services`\ndirectories to `~/airprint_data/config` and `~/airprint_data/services`\nrespectively, but these could just as well be anywhere on your file system.\n\n### \u003ca name=\"dparams\"\u003e\u003c/a\u003e [Parameters](#toc)\n* `--name`: gives the container a name making it easier to work with/on (e.g.\n  `cups`)\n* `--restart`: restart policy for how to handle restarts (e.g. `always` restart)\n* `--net`: network to join (e.g. the `host` network)\n* `-v ~/airprint_data/config:/config`: where the persistent printer configs\n   will be stored\n* `-v ~/airprint_data/services:/services`: where the Avahi service files will\n   be generated\n* `-e CUPSADMIN`: the CUPS admin user you want created\n* `-e CUPSPASSWORD`: the password for the CUPS admin user\n* `--device /dev/bus`: device mounted for interacting with USB printers\n* `--device /dev/usb`: device mounted for interacting with USB printers\n\n## \u003ca name=\"dcompose\"\u003e\u003c/a\u003e [Docker Compose](#toc)\nIf you don't want to type out these long **Docker** commands, you could\noptionally use [docker-compose](https://docs.docker.com/compose/) to set up your\nimage. Just download the repo and run it like so:\n```\ngit clone https://github.com/RagingTiger/docker-cups-airprint\ncd docker-cups-airprint\ndocker-compose up\n```\nNOTE: This compose file is made with `USB` printers in mind and like the above\ncommands has `device` mounts for `USB` printers. If you don't have a `USB`\nprinter you may want to comment these out. Also the `config/services` data will\nbe saved to the users `$HOME` directory. Again you may want to edit this to\nyour own liking.\n\n## \u003ca name=\"dbuild\"\u003e\u003c/a\u003e [Docker Build](#toc)\nIf you would like to build the image yourself (locally), pull down the repo and\nrun the `docker build` command as follows:\n```\ngit clone https://github.com/RagingTiger/docker-cups-airprint\ncd docker-cups-airprint\ndocker build -t tigerj/cups-airprint .\n```\nFollow this with a [docker run](#drun) or [docker create](dcreate) to deploy\nyour container and your **cups-airprint** server is ready to be configured and\n[used](#using).\n\n## \u003ca name=\"using\"\u003e\u003c/a\u003e [Using](#toc)\nCUPS will be configurable at http://localhost:631 using the\nCUPSADMIN/CUPSPASSWORD when you do something administrative.\n\nIf the `/services` volume isn't mapping to `/etc/avahi/services` then you will\nhave to manually copy the .service files to that path at the command line.\n\n## \u003ca name=\"notes\"\u003e\u003c/a\u003e [Notes](#toc)\n* CUPS doesn't write out `printers.conf` immediately when making changes even\nthough they're live in CUPS. Therefore it will take a few moments before the\nservices files update\n* Don't stop the container immediately if you intend to have a persistent\nconfiguration for this same reason\n\n## \u003ca name=\"trouble\"\u003e\u003c/a\u003e [Trouble Shooting](#toc)\nHere we are going to discuss the most **common problems** that users have when\ntrying to setup and configure their printer to work with the\n**tigerj/cups-airprint** image.\n\n### \u003ca name=\"missing-driver\"\u003e\u003c/a\u003e [Missing Printer Driver](#toc)\nAs you might imagine this is **the most common** problem users have when setting\nup their printers. While the **tigerj/cups-airprint** image possesses\n**multiple printer drivers**, it most likely **does not** have every driver for\nevery printer. This issue can be resolved as follows:\n\n+ Figure out what printer driver you need, open an issue about missing driver,\n  necessary package containing said driver will be added to **Dockerfile**.\n\n### \u003ca name=\"driver-version\"\u003e\u003c/a\u003e [Driver Version](#toc)\nSometimes the right printer driver is installed in the **tigerj/cups-airprint**\nDocker image, but the **version** is not current. This issue may require one of\ntwo choices to resolve:\n\n+ Download the **docker-cups-airprint** git repo and build a fresh image\n  + This will pull the most recent versions of the printer driver from the package\n    manager.\n\n+ Download driver **DIRECTLY** from the manufacturer and add it to the image\n  + If building a fresh image does not update the version of the driver, then\n    you will need the most recent printer driver from the manufacturer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRagingTiger%2Fcups-airprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRagingTiger%2Fcups-airprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRagingTiger%2Fcups-airprint/lists"}