Initial Commit
This commit is contained in:
commit
ea024b830b
12
.editorconfig
Normal file
12
.editorconfig
Normal file
@ -0,0 +1,12 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = false
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
**/Makefile text eol=lf
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.DS_Store
|
5
.travis.yml
Normal file
5
.travis.yml
Normal file
@ -0,0 +1,5 @@
|
||||
services:
|
||||
- docker
|
||||
|
||||
script:
|
||||
- make push
|
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
# Base-Image
|
||||
FROM ubuntu:18.04
|
||||
|
||||
# Environment
|
||||
ENV CUPS_ADMIN_USER=print
|
||||
ENV CUPS_ADMIN_PASSWD=print
|
||||
|
||||
# Labels
|
||||
LABEL maintainer="Markus Pesch"
|
||||
|
||||
# Non-Interactive
|
||||
ENV DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
# Software installation
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade --yes && \
|
||||
apt-get install --yes \
|
||||
sudo \
|
||||
cups \
|
||||
cups-client \
|
||||
cups-bsd \
|
||||
cups-filters \
|
||||
foomatic-db-compressed-ppds \
|
||||
printer-driver-all \
|
||||
openprinting-ppds \
|
||||
hpijs-ppds \
|
||||
hp-ppd \
|
||||
hplip && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||
|
||||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh"]
|
16
Makefile
Normal file
16
Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
# VERSION
|
||||
# If no version is specified as a parameter of make, the last git hash
|
||||
# value is taken.
|
||||
VERSION?=latest
|
||||
|
||||
# DOCKER_USER
|
||||
DOCKER_USER?=volkerraschek
|
||||
|
||||
build:
|
||||
docker build \
|
||||
--tag ${DOCKER_USER}/cupsd:${VERSION} \
|
||||
.
|
||||
|
||||
push: build
|
||||
docker login --username ${DOCKER_USER} --password ${DOCKER_PASSWORD}
|
||||
docker push ${DOCKER_USER}/cupsd:${VERSION}
|
38
README.md
Normal file
38
README.md
Normal file
@ -0,0 +1,38 @@
|
||||
# cups
|
||||
Common Unix Printing System (CUPS), is the most widely used printing system on Linux
|
||||
systems. CUPS allows you to use, manage and share many printers on the network,
|
||||
as it is designed as a client/server system.
|
||||
|
||||
This repository contains only build scripts for the CUPS daemon.
|
||||
|
||||
## Usage
|
||||
To start cups directly over cli:
|
||||
|
||||
```bash
|
||||
docker run \
|
||||
--detach \
|
||||
--env CUPS_ADMIN_USER=print \
|
||||
--env CUPS_ADMIN_PASSWD=print \
|
||||
--network=host \
|
||||
--volume /var/run/dbus:/var/run/dbus \
|
||||
--name cupsd \
|
||||
volkerraschek/cupsd
|
||||
```
|
||||
|
||||
or if you want to use a `docker-compose.yml`
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
cupsd:
|
||||
container_name: cupsd
|
||||
environment:
|
||||
- CUPS_ADMIN_USER=print
|
||||
- CUPS_ADMIN_PASSWD=print
|
||||
network_mode: host
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/run/dbus:/var/run/dbus
|
||||
```
|
||||
|
||||
After starting the container, cups is available over http://localhost:631
|
14
entrypoint.sh
Normal file
14
entrypoint.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
useradd \
|
||||
--groups=sudo,lp,lpadmin \
|
||||
--create-home \
|
||||
--home-dir=/home/${CUPS_ADMIN_USER} \
|
||||
--shell=/bin/bash \
|
||||
${CUPS_ADMIN_USER}
|
||||
|
||||
echo "${CUPS_ADMIN_USER}:${CUPS_ADMIN_PASSWD}" | chpasswd
|
||||
|
||||
sed --in-place '/%sudo[[:space:]]/ s/ALL[[:space:]]*$/NOPASSWD:ALL/' /etc/sudoers
|
||||
|
||||
/usr/sbin/cupsd -f
|
Loading…
Reference in New Issue
Block a user