First commit
This commit is contained in:
parent
36c36f5a93
commit
049d96aa36
10
Dockerfile
10
Dockerfile
@ -38,13 +38,13 @@ RUN apt-get update \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# add print user
|
||||
RUN adduser --home /home/${ADMIN_USERNAME} --shell /bin/bash --gecos "${ADMIN_USERNAME}" --disabled-password ${ADMIN_USERNAME} \
|
||||
&& adduser ${ADMIN_USERNAME} sudo \
|
||||
&& adduser ${ADMIN_USERNAME} lp \
|
||||
&& adduser ${ADMIN_USERNAME} lpadmin
|
||||
RUN adduser --home /home/admin --shell /bin/bash --gecos "admin" --disabled-password admin \
|
||||
&& adduser admin sudo \
|
||||
&& adduser admin lp \
|
||||
&& adduser admin lpadmin
|
||||
|
||||
# disable sudo password checking
|
||||
RUN echo '${ADMIN_USERNAME} ALL=(ALL:ALL) ALL' >> /etc/sudoers
|
||||
RUN echo 'admin ALL=(ALL:ALL) ALL' >> /etc/sudoers
|
||||
|
||||
# enable access to CUPS
|
||||
RUN /usr/sbin/cupsd \
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
echo -e "${ADMIN_PASSWORD}\n${ADMIN_PASSWORD}" | passwd ${ADMIN_USERNAME}
|
||||
echo -e "${ADMIN_PASSWORD}\n${ADMIN_PASSWORD}" | passwd admin
|
||||
|
||||
if [ ! -f /etc/cups/cupsd.conf ]; then
|
||||
cp -rpn /etc/cups-skel/* /etc/cups/
|
||||
|
70
old
70
old
@ -1,70 +0,0 @@
|
||||
# base image
|
||||
ARG ARCH=amd64
|
||||
FROM $ARCH/debian:bullseye-slim
|
||||
|
||||
# args
|
||||
ARG VCS_REF
|
||||
ARG BUILD_DATE
|
||||
|
||||
# environment
|
||||
ENV ADMIN_PASSWORD=admin
|
||||
ENV ADMIN_USERNAME=admin
|
||||
|
||||
# labels
|
||||
LABEL maintainer="Sthope <hopelessautomations@gmail.com>" \
|
||||
org.label-schema.schema-version="1.0" \
|
||||
org.label-schema.name="sthopeless/cups" \
|
||||
org.label-schema.description="Simple CUPS docker image" \
|
||||
org.label-schema.version="0.1" \
|
||||
org.label-schema.url="https://hub.docker.com/r/sthopeless/cups" \
|
||||
org.label-schema.vcs-url="https://git.sthope.dev/sthope/Docker-cups" \
|
||||
org.label-schema.vcs-ref=$VCS_REF \
|
||||
org.label-schema.build-date=$BUILD_DATE
|
||||
|
||||
# install packages
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
sudo \
|
||||
cups \
|
||||
cups-bsd \
|
||||
cups-filters \
|
||||
foomatic-db-compressed-ppds \
|
||||
printer-driver-all \
|
||||
openprinting-ppds \
|
||||
hpijs-ppds \
|
||||
hp-ppd \
|
||||
hplip \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# add print user
|
||||
RUN adduser --home /home/admin --shell /bin/bash --gecos "admin" --disabled-password admin \
|
||||
&& adduser admin sudo \
|
||||
&& adduser admin lp \
|
||||
&& adduser admin lpadmin
|
||||
|
||||
# disable sudo password checking
|
||||
RUN echo 'admin ALL=(ALL:ALL) ALL' >> /etc/sudoers
|
||||
|
||||
# enable access to CUPS
|
||||
RUN /usr/sbin/cupsd \
|
||||
&& while [ ! -f /var/run/cups/cupsd.pid ]; do sleep 1; done \
|
||||
&& cupsctl --remote-admin --remote-any --share-printers \
|
||||
&& kill $(cat /var/run/cups/cupsd.pid) \
|
||||
&& echo "ServerAlias *" >> /etc/cups/cupsd.conf
|
||||
|
||||
# copy /etc/cups for skeleton usage
|
||||
RUN cp -rp /etc/cups /etc/cups-skel
|
||||
|
||||
# entrypoint
|
||||
ADD docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
ENTRYPOINT [ "docker-entrypoint.sh" ]
|
||||
|
||||
# default command
|
||||
CMD ["cupsd", "-f"]
|
||||
|
||||
# volumes
|
||||
VOLUME ["/etc/cups"]
|
||||
|
||||
# ports
|
||||
EXPOSE 631
|
Loading…
x
Reference in New Issue
Block a user