FROM alpine:latest
COPY init/entrypoint.sh /usr/local/bin
RUN chmod +x /usr/local/bin/entrypoint.sh && \
apk add --update --no-cache \
cups cups-filters cups-libs && \
sed -i 's/Listen localhost:631/Listen 0.0.0.0:631/' /etc/cups/cupsd.conf && \
sed -i 's//\n Allow All/' /etc/cups/cupsd.conf && \
sed -i 's//\n Allow All\n Require user @SYSTEM/' /etc/cups/cupsd.conf && \
sed -i 's//\n Allow All/' /etc/cups/cupsd.conf && \
echo "ServerAlias *" >> /etc/cups/cupsd.conf && \
echo "DefaultEncryption Never" >> /etc/cups/cupsd.conf
VOLUME /etc/cups /var/log/cups /var/spool/cups /var/spool/cups-pdf /var/cache/cups
EXPOSE 631
CMD ["/usr/local/bin/entrypoint.sh"]