Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
digibib
kohaprinter
Commits
b338dcf9
Commit
b338dcf9
authored
Jan 23, 2020
by
Benjamin Rokseth
Browse files
Create docker image and compose file
parent
3e71c0ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Dockerfile
0 → 100644
View file @
b338dcf9
FROM
golang:1.13 AS builder
MAINTAINER
opl@deichman.no
WORKDIR
/app
COPY
kohaprinter.* .
RUN
CGO_ENABLED
=
0 go build
-o
kohaprinter
FROM
debian:testing
# Install Packages (basic tools, cups, basic drivers, HP drivers)
RUN
apt-get update
&&
\
dpkg
--add-architecture
i386
&&
\
apt-get
install
-y
\
sudo
whois cups cups-client cups-bsd cups-filters foomatic-db-compressed-ppds printer-driver-all openprinting-ppds
\
hpijs-ppds hp-ppd hplip smbclient
&&
\
apt-get clean
# Add user and disable sudo password checking
RUN
useradd
--groups
=
sudo
,lp,lpadmin
--create-home
--home-dir
=
/home/print
--shell
=
/bin/bash
--password
=
$(
mkpasswd print
)
print
&&
\
sed
-i
'/%sudo[[:space:]]/ s/ALL[[:space:]]*$/NOPASSWD:ALL/'
/etc/sudoers
# Kohaprinter backend and extra cups drivers
COPY
--from=builder /app/kohaprinter /usr/lib/cups/backend/
COPY
drivers /
COPY
config/ /etc/cups/
RUN
chown
.lp /etc/cups/ppd/
*
.ppd
# RUN dpkg -i --force-architecture ql720nwlpr-1.0.1-1.i386.deb
# dpkg -i --force-architecture ql720nwcupswrapper-1.0.1-1.i386.deb
# cp /usr/lib/cups/filter/brlpdwrapper* /usr/lib64/cups/filter
# cp /usr/lib/cups/filter/brlpdwrapper* /usr/lib64/cups/filter
# Extra ppds
#COPY ./ppd/* /usr/share/cups/model/
# Configure the service's to be reachable
# RUN /usr/sbin/cupsd &&\
# while [ ! -f /var/run/cups/cupsd.pid ]; do sleep 1; done &&\
# cupsctl --remote-admin --share-printers &&\
# kill $(cat /var/run/cups/cupsd.pid)
RUN
dpkg
-i
--force-all
--force-architecture
/ql720nwpdrv-3.1.5-0.i386.deb
&&
apt-get clean
&&
\
rm
-rf
/var/lib/apt/lists/
*
COPY
startCups.sh /
CMD
["/startCups.sh"]
\ No newline at end of file
docker-compose.yml
0 → 100644
View file @
b338dcf9
version
:
"
3.5"
networks
:
kohaprinter
:
driver
:
bridge
volumes
:
rqlite_data
:
{}
services
:
cups
:
image
:
cups:latest
container_name
:
cups
build
:
context
:
.
ports
:
-
"
631:631"
volumes
:
-
/var/run/dbus:/var/run/dbus
-
./config:/etc/cups
networks
:
-
kohaprinter
athena
:
container_name
:
athenapdf
image
:
arachnysdocker/athenapdf-service:latest
networks
:
-
kohaprinter
ports
:
-
"
8089:8080"
volumes
:
-
"
rqlite_data:/data"
logging
:
driver
:
"
json-file"
options
:
max-size
:
"
1m"
max-file
:
"
2"
startCups.sh
0 → 100755
View file @
b338dcf9
#!/usr/bin/env bash
pid
=
0
# SIGUSR1-handler
my_handler
()
{
echo
"my_handler"
}
# SIGTERM-handler
term_handler
()
{
if
[
$pid
-ne
0
]
;
then
kill
-SIGTERM
"
$pid
"
wait
"
$pid
"
fi
exit
143
;
# 128 + 15 -- SIGTERM
}
# setup handlers
trap
'kill ${!}; my_handler'
SIGUSR1
trap
'kill ${!}; term_handler'
SIGTERM
trap
'kill ${!}; term_handler'
SIGINT
# run application
/usr/sbin/cupsd
-f
&
pid
=
"
$!
"
# wait forever
while
true
do
tail
-f
/dev/null &
wait
${
!
}
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment