mirror of
https://github.com/b4tman/docker-squid.git
synced 2024-11-23 19:56:55 +00:00
CMD /run.sh
This commit is contained in:
parent
2bd55e0a98
commit
a3b674e1d5
@ -127,6 +127,8 @@ COPY --from=build /usr/lib/squid/ /usr/lib/squid/
|
|||||||
COPY --from=build /usr/share/squid/ /usr/share/squid/
|
COPY --from=build /usr/share/squid/ /usr/share/squid/
|
||||||
COPY --from=build /usr/sbin/squid /usr/sbin/squid
|
COPY --from=build /usr/sbin/squid /usr/sbin/squid
|
||||||
COPY --from=build /usr/bin/squidclient /usr/bin/squidclient
|
COPY --from=build /usr/bin/squidclient /usr/bin/squidclient
|
||||||
|
|
||||||
|
COPY --chmod=755 run.sh /
|
||||||
|
|
||||||
RUN install -d -o squid -g squid \
|
RUN install -d -o squid -g squid \
|
||||||
/var/cache/squid \
|
/var/cache/squid \
|
||||||
@ -144,4 +146,4 @@ EXPOSE 3128/tcp
|
|||||||
|
|
||||||
USER squid
|
USER squid
|
||||||
|
|
||||||
CMD ["sh", "-c", "rm -f /var/run/squid/squid.pid ; /usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -z && exec /usr/sbin/squid -f ${SQUID_CONFIG_FILE} --foreground -YCd 1"]
|
CMD ["/run.sh"]
|
||||||
|
14
run.sh
Normal file
14
run.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# force remove pid
|
||||||
|
if [ -e /var/run/squid/squid.pid ]; then
|
||||||
|
rm -f /var/run/squid/squid.pid
|
||||||
|
fi
|
||||||
|
|
||||||
|
# init cache
|
||||||
|
/usr/sbin/squid -f "${SQUID_CONFIG_FILE}" --foreground -z
|
||||||
|
|
||||||
|
# run squid
|
||||||
|
exec /usr/sbin/squid -f "${SQUID_CONFIG_FILE}" --foreground -YCd 1
|
Loading…
Reference in New Issue
Block a user