mirror of
https://github.com/b4tman/docker-squid.git
synced 2024-11-21 18:56:54 +00:00
CMD /run.sh
This commit is contained in:
parent
2bd55e0a98
commit
a3b674e1d5
@ -128,6 +128,8 @@ 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 \
|
||||||
/var/log/squid \
|
/var/log/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