Merge ~ubuntu-docker-images/ubuntu-docker-images/+git/squid:initial-adjustments into ~ubuntu-docker-images/ubuntu-docker-images/+git/squid:main

Proposed by Athos Ribeiro
Status: Merged
Merge reported by: Athos Ribeiro
Merged at revision: 9f46604ac59e024049a4b03d2d786fabeb1e4557
Proposed branch: ~ubuntu-docker-images/ubuntu-docker-images/+git/squid:initial-adjustments
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/squid:main
Diff against target: 51 lines (+3/-6)
4 files modified
Dockerfile (+1/-2)
README.md (+0/-1)
data/squid.yaml (+0/-3)
entrypoint.sh (+2/-0)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior Approve
Bryce Harrington Pending
Canonical Server Pending
Review via email: mp+408039@code.launchpad.net

Description of the change

Do not generate default volume for configuration. Configuration should be provided by users and there is no point into storing the default, provided configurations into a volume.

Also, create missing cache directories to ensure they are available before starting the service.

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks, Athos.

This LGTM. I was unsure whether the "squid -Nz" command would always return, but I did some tests in a container here and it seems that it does.

+1

review: Approve
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thank you, Sergio!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Dockerfile b/Dockerfile
2index 605b3d2..f7a01f4 100644
3--- a/Dockerfile
4+++ b/Dockerfile
5@@ -20,8 +20,7 @@ RUN set -eux; \
6
7 EXPOSE 3128
8 VOLUME /var/log/squid \
9- /var/spool/squid \
10- /etc/squid
11+ /var/spool/squid
12
13 COPY entrypoint.sh /usr/local/bin/entrypoint.sh
14 ENTRYPOINT ["entrypoint.sh"]
15diff --git a/README.md b/README.md
16index 4bf9d5a..7eccbf1 100644
17--- a/README.md
18+++ b/README.md
19@@ -40,7 +40,6 @@ Access your Squid proxy at `localhost:3128`.
20 |---|---|
21 | `-e TZ=UTC` | Timezone. |
22 | `-p 3128:3128` | Expose the proxy service |
23-| `-v /path/to/configuration:/etc/squid` | Directory with squid configuration files |
24 | `-v /path/to/logs:/var/log/squid` | Volume to store squid logs |
25 | `-v /path/to/data:/var/spool/squid` | Volume to store the squid cache |
26
27diff --git a/data/squid.yaml b/data/squid.yaml
28index 69acd08..6f90f3c 100644
29--- a/data/squid.yaml
30+++ b/data/squid.yaml
31@@ -26,9 +26,6 @@ parameters:
32 value: 3128:3128
33 description: Expose the proxy service
34 - type: -v
35- value: /path/to/configuration:/etc/squid
36- description: Directory with squid configuration files
37- - type: -v
38 value: /path/to/logs:/var/log/squid
39 description: Volume to store squid logs
40 - type: -v
41diff --git a/entrypoint.sh b/entrypoint.sh
42index 5c3c9cd..d34a01e 100755
43--- a/entrypoint.sh
44+++ b/entrypoint.sh
45@@ -20,4 +20,6 @@ tail -F /var/log/squid/access.log 2>/dev/null &
46 tail -F /var/log/squid/error.log 2>/dev/null &
47 tail -F /var/log/squid/store.log 2>/dev/null &
48 tail -F /var/log/squid/cache.log 2>/dev/null &
49+# create missing cache directories and exit
50+/usr/sbin/squid -Nz
51 /usr/sbin/squid "$@"

Subscribers

People subscribed via source and target branches

to all changes: