Merge ~ubuntu-docker-images/ubuntu-docker-images/+git/templates:memcached into ~ubuntu-docker-images/ubuntu-docker-images/+git/templates:master

Proposed by Sergio Durigan Junior
Status: Merged
Merged at revision: f6c2538b19f6ef3270eb6cddea1a833a1e25fcb4
Proposed branch: ~ubuntu-docker-images/ubuntu-docker-images/+git/templates:memcached
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/templates:master
Diff against target: 191 lines (+179/-0)
2 files modified
data/memcached.yaml (+70/-0)
out/memcached.md (+109/-0)
Reviewer Review Type Date Requested Status
Valentin Viennot (community) Needs Fixing
Richard Harding Pending
Lucas Kanashiro Pending
Canonical Server Pending
Review via email: mp+394277@code.launchpad.net

Description of the change

Memcached data (needed to generate the README file) and the corresponding memcached.md (generated from the data).

To post a comment you must log in.
Revision history for this message
Valentin Viennot (valentinviennot) wrote :

Some issues in the debug section, I added my fix proposal as a comment on line 44 (you can simply copy paste it to fix the whole debug.text section), and comments about the issues on the related lines.

review: Needs Fixing
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Saturday, November 21 2020, Valentin Viennot wrote:

> Review: Needs Fixing
>
> Some issues in the debug section, I added my fix proposal as a comment
> on line 44 (you can simply copy paste it to fix the whole debug.text
> section), and comments about the issues on the related lines.

Ah, good catch. I applied the fix you proposed and merged the MP.
Thanks!

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/data/memcached.yaml b/data/memcached.yaml
2new file mode 100644
3index 0000000..57707d3
4--- /dev/null
5+++ b/data/memcached.yaml
6@@ -0,0 +1,70 @@
7+application: Memcached
8+repo: memcached
9+description: >
10+ Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. It is a short-term memory for applications.
11+ Memcached allows to take memory from parts of a system where you have more than you need and make it accessible to areas where you have less than you need. Read more on the [memcached website](https://memcached.org/).
12+version: 1.5.22
13+base: Ubuntu 20.04 LTS
14+architectures:
15+ - amd64
16+ - arm64
17+ - ppc64el
18+ - s390x
19+docker:
20+ nothing:
21+parameters:
22+ - type: -e
23+ value: TZ=UTC
24+ description: Timezone.
25+ - type: -e
26+ value: MEMCACHED_CACHE_SIZE=64MB
27+ description: Determines the size of the cache.
28+ - type: -e
29+ value: MEMCACHED_MAX_CONNECTIONS=1024
30+ description: Determines the maximum number of concurrent connections.
31+ - type: -e
32+ value: MEMCACHED_THREADS=4
33+ description: Determines the number of threads to process requests.
34+ - type: -e
35+ value: MEMCACHED_PASSWORD
36+ description: Define the password for the `root` user if another username is provided. By default the authentication is disabled but if this option is passed it becomes enabled.
37+ - type: -e
38+ value: MEMCACHED_USERNAME
39+ description: Define a new user. If this option is passed a password is needed to authenticate the new user.
40+ - type: -p
41+ value: 11211
42+ description: Memcached is exposed inside the container on port `11211`.
43+debug:
44+ text: |
45+ <details>
46+ <summary>You can access the Memcached instance with telnet from another container (click to expand).</summary>
47+
48+ ```sh
49+ # Create a dedicated network
50+ $ docker network create memcached-network
51+ # Connect the main container to it
52+ $ docker network connect memcached-network memcached-container
53+ # Run an interactive container with the latest Ubuntu
54+ $ docker run -it --rm --name telnet --network memcached-network ubuntu bash
55+ # Install the telnet cli from within the container
56+ > apt update && apt install telnet -y
57+ # Connect to the memcached instance using telnet
58+ > telnet memcached-container 11211
59+ Trying 172.30.0.2...
60+ Connected to memcached.
61+ Escape character is '^]'.
62+ ```
63+ From there you can run `memcached` commands, as documented in [their wiki](https://github.com/memcached/memcached/wiki/Commands).
64+
65+ </details>
66+
67+ ```sh
68+ $ telnet memcached-container 11211
69+ ```
70+
71+ There are cases where one might want to pass some memcached command line flags that are not configurable via environment variables.
72+ In this case you can append the flags themselves or a shell script to the run command.
73+microk8s:
74+ deploy:
75+ link: https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/memcached/plain/examples/memcached-deployment.yml
76+ access: Memcached will be listening on port `31211` in your host.
77diff --git a/out/memcached.md b/out/memcached.md
78new file mode 100644
79index 0000000..6fa68db
80--- /dev/null
81+++ b/out/memcached.md
82@@ -0,0 +1,109 @@
83+# Memcached | Ubuntu
84+
85+
86+## About Memcached
87+
88+Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. It is a short-term memory for applications. Memcached allows to take memory from parts of a system where you have more than you need and make it accessible to areas where you have less than you need. Read more on the [memcached website](https://memcached.org/).
89+
90+
91+## Tags and Architectures
92+
93+
94+| Tag | Currently | Architectures |
95+|---|---|---|
96+| `1.x` &nbsp;&nbsp; ![BETA](https://assets.ubuntu.com/v1/e8ac33d1-header-beta-flag.svg) | Memcached 1.5.22 on Ubuntu 20.04 LTS | `amd64`, `arm64`, `ppc64el`, `s390x` |
97+
98+## Usage
99+
100+Launch this image locally:
101+
102+```sh
103+docker run -d --name memcached-container -e TZ=UTC ubuntu/memcached:1.x
104+```
105+
106+
107+#### Parameters
108+
109+| Parameter | Description |
110+|---|---|
111+| `-e TZ=UTC` | Timezone. |
112+| `-e MEMCACHED_CACHE_SIZE=64MB` | Determines the size of the cache. |
113+| `-e MEMCACHED_MAX_CONNECTIONS=1024` | Determines the maximum number of concurrent connections. |
114+| `-e MEMCACHED_THREADS=4` | Determines the number of threads to process requests. |
115+| `-e MEMCACHED_PASSWORD` | Define the password for the `root` user if another username is provided. By default the authentication is disabled but if this option is passed it becomes enabled. |
116+| `-e MEMCACHED_USERNAME` | Define a new user. If this option is passed a password is needed to authenticate the new user. |
117+| `-p 11211` | Memcached is exposed inside the container on port `11211`. |
118+
119+
120+#### Testing/Debugging
121+
122+To debug the container:
123+
124+```sh
125+$ docker logs -f memcached-container
126+```
127+
128+To get an interactive shell:
129+
130+```sh
131+$ docker exec -it memcached-container /bin/bash
132+```
133+
134+<details>
135+<summary>You can access the Memcached instance with telnet from another container (click to expand).</summary>
136+
137+```sh
138+# Create a dedicated network
139+$ docker network create memcached-network
140+# Connect the main container to it
141+$ docker network connect memcached-network memcached-container
142+# Run an interactive container with the latest Ubuntu
143+$ docker run -it --rm --name telnet --network memcached-network ubuntu bash
144+# Install the telnet cli from within the container
145+> apt update && apt install telnet -y
146+# Connect to the memcached instance using telnet
147+> telnet memcached-container 11211
148+Trying 172.30.0.2...
149+Connected to memcached.
150+Escape character is '^]'.
151+```
152+From there you can run `memcached` commands, as documented in [their wiki](https://github.com/memcached/memcached/wiki/Commands).
153+
154+</details>
155+
156+```sh
157+$ telnet memcached-container 11211
158+```
159+
160+There are cases where one might want to pass some memcached command line flags that are not configurable via environment variables.
161+In this case you can append the flags themselves or a shell script to the run command.
162+
163+
164+## Deploy with Kubernetes
165+
166+
167+
168+Works with any Kubernetes; if you don't have one, we recommend you [install MicroK8s](https://microk8s.io/) and `microk8s enable dns storage` then alias `kubectl` to `microk8s.kubectl`.
169+
170+Download
171+[memcached-deployment.yml](https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/memcached/plain/examples/memcached-deployment.yml). Then:
172+
173+```sh
174+$ kubectl apply -f memcached-deployment.yml
175+```
176+
177+Memcached will be listening on port `31211` in your host.
178+
179+## Bugs and feature requests
180+
181+If you find a bug in our image or want to request a specific feature, please file a bug here:
182+
183+[https://bugs.launchpad.net/ubuntu-docker-images/+filebug](https://bugs.launchpad.net/ubuntu-docker-images/+filebug)
184+
185+Please title the bug "`memcached: <reason>`".
186+
187+Make sure to include the digest of the image you are using, from:
188+```sh
189+$ docker images --no-trunc --quiet ubuntu/memcached:<tag>
190+```
191+

Subscribers

People subscribed via source and target branches

to all changes: