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

Proposed by Athos Ribeiro
Status: Merged
Merged at revision: c44d0c1bc71e27c92f4757cae59fd59534c8f8de
Proposed branch: ~ubuntu-docker-images/ubuntu-docker-images/+git/squid:main-wip
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/squid:main
Diff against target: 102 lines (+36/-11)
4 files modified
Dockerfile (+2/-1)
README.md (+4/-2)
data/squid.yaml (+12/-7)
entrypoint.sh (+18/-1)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior Approve
Bryce Harrington Pending
Canonical Server Pending
Review via email: mp+407858@code.launchpad.net

Description of the change

As per the review suggestions in our mailing list, this MP updates the OCI documentation and allows for parameters to be passed through CMD. The latter was done in a much simpler way than the one present in redis image due to how the parameters are being passed to the image. Moreover, in the most basic use case the users will not need to pass any parameters, but mount the configuration file instead.

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

Thanks, Athos. LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Dockerfile b/Dockerfile
2index 4b8bfe9..605b3d2 100644
3--- a/Dockerfile
4+++ b/Dockerfile
5@@ -24,4 +24,5 @@ VOLUME /var/log/squid \
6 /etc/squid
7
8 COPY entrypoint.sh /usr/local/bin/entrypoint.sh
9-CMD entrypoint.sh
10+ENTRYPOINT ["entrypoint.sh"]
11+CMD ["-f", "/etc/squid/squid.conf", "-NYC"]
12diff --git a/README.md b/README.md
13index 772a2db..4bf9d5a 100644
14--- a/README.md
15+++ b/README.md
16@@ -5,7 +5,7 @@ Current Squid Docker Image from Ubuntu. Receives security updates and rolls to n
17
18 ## About Squid
19
20-Squid is a fully-featured HTTP/1.0 proxy which is almost (but not quite - we're getting there!) a fully-featured HTTP/1.1 proxy. Squid offers a rich access control, authorization and logging environment to develop web proxy and content serving applications. Squid offers a rich set of traffic optimization options, most of which are enabled by default for simpler installation and high performance.
21+Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows and is licensed under the GNU GPL.
22
23
24 ## Tags and Architectures
25@@ -65,9 +65,11 @@ docker exec -it squid-container /bin/bash
26 Works with any Kubernetes; if you don't have one, we recommend you [install MicroK8s](https://microk8s.io/) and `microk8s.enable dns storage` then `snap alias microk8s.kubectl kubectl`.
27
28 Download
29-[squid-deployment.yml](TBD) and set `containers.squid.image` in `squid-deployment.yml` to your chosen channel tag (e.g. `ubuntu/squid:4.13-21.10_beta`), then:
30+[squid.conf](https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/squid/plain/examples/config/squid.conf) and
31+[squid-deployment.yml](https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/squid/plain/examples/squid-deployment.yml) and set `containers.squid.image` in `squid-deployment.yml` to your chosen channel tag (e.g. `ubuntu/squid:4.13-21.10_beta`), then:
32
33 ```sh
34+kubectl create configmap squid-config --from-file=squid=squid.conf
35 kubectl apply -f squid-deployment.yml
36 ```
37
38diff --git a/data/squid.yaml b/data/squid.yaml
39index 3079ff7..69acd08 100644
40--- a/data/squid.yaml
41+++ b/data/squid.yaml
42@@ -2,12 +2,11 @@ application: Squid
43 main: true
44 repo: squid
45 description: >
46- Squid is a fully-featured HTTP/1.0 proxy which is almost (but not quite -
47- we're getting there!) a fully-featured HTTP/1.1 proxy. Squid offers a rich
48- access control, authorization and logging environment to develop web proxy
49- and content serving applications. Squid offers a rich set of traffic
50- optimization options, most of which are enabled by default for simpler
51- installation and high performance.
52+ Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more.
53+ It reduces bandwidth and improves response times by caching and reusing
54+ frequently-requested web pages. Squid has extensive access controls and makes
55+ a great server accelerator. It runs on most available operating systems,
56+ including Windows and is licensed under the GNU GPL.
57 version: "4.13"
58 base: Ubuntu 21.10
59 architectures:
60@@ -38,6 +37,12 @@ parameters:
61 debug:
62 - nothing
63 microk8s:
64+ configmap:
65+ name: squid-config
66+ files:
67+ - key: squid
68+ name: squid.conf
69+ link: https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/squid/plain/examples/config/squid.conf
70 deploy:
71- link: TBD
72+ link: https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/squid/plain/examples/squid-deployment.yml
73 access: You can now access the squid proxy on port 3128
74diff --git a/entrypoint.sh b/entrypoint.sh
75index fe40175..5c3c9cd 100755
76--- a/entrypoint.sh
77+++ b/entrypoint.sh
78@@ -1,6 +1,23 @@
79 #!/bin/bash
80
81+# Squid OCI image entrypoint
82+
83+# This entrypoint aims to forward the squid logs to stdout to assist users of
84+# common container related tooling (e.g., kubernetes, docker-compose, etc) to
85+# access the service logs.
86+
87+# Moreover, it invokes the squid binary, leaving all the desired parameters to
88+# be provided by the "command" passed to the spawned container. If no command
89+# is provided by the user, the default behavior (as per the CMD statement in
90+# the Dockerfile) will be to use Ubuntu's default configuration [1] and run
91+# squid with the "-NYC" options to mimic the behavior of the Ubuntu provided
92+# systemd unit.
93+
94+# [1] The default configuration is changed in the Dockerfile to allow local
95+# network connections. See the Dockerfile for further information.
96+
97 tail -F /var/log/squid/access.log 2>/dev/null &
98 tail -F /var/log/squid/error.log 2>/dev/null &
99 tail -F /var/log/squid/store.log 2>/dev/null &
100-/usr/sbin/squid -f /etc/squid/squid.conf -NYC
101+tail -F /var/log/squid/cache.log 2>/dev/null &
102+/usr/sbin/squid "$@"

Subscribers

People subscribed via source and target branches

to all changes: