Merge ~valentinviennot/ubuntu-docker-images:update-memcached-readme into ~ubuntu-docker-images/ubuntu-docker-images/+git/memcached:edge

Proposed by Valentin Viennot
Status: Merged
Merged at revision: a0b77f23659f5a1b19efe6011aca50600bf95254
Proposed branch: ~valentinviennot/ubuntu-docker-images:update-memcached-readme
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/memcached:edge
Diff against target: 72 lines (+31/-8)
1 file modified
README.md (+31/-8)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior Approve
Richard Harding Pending
Review via email: mp+393901@code.launchpad.net

Description of the change

Extra parameters and additional debug docs (collapsible section).

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

OK. I will address my comment about the network name in a subsequent commit.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/README.md b/README.md
2index b8a8027..dd5f31d 100644
3--- a/README.md
4+++ b/README.md
5@@ -21,18 +21,20 @@ Read more on the [memcached website](https://memcached.org/).
6
7 ```sh
8 $ docker network create app-net --driver bridge
9-$ docker run -d --name memcached --network app-net squeakywheel/memcached:edge
10+$ docker run -d --name memcached --network app-net -e TZ=Europe/London squeakywheel/memcached:edge
11 ```
12
13 #### Parameters
14
15 | Parameter | Description |
16 |---|---|
17-| `-e MEMCACHED_CACHE_SIZE=64MB` | Determines the size of the cache |
18-| `-e MEMCACHED_MAX_CONNECTIONS=1024` | Determines the maximum number of concurrent connections |
19-| `-e MEMCACHED_THREADS=4` | Determines the number of threads to process requests |
20-| `-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 |
21-| `-e MEMCACHED_USERNAME` | Define a new user. If this option is passed a password is needed to authenticate the new user |
22+| `-e TZ=UTC` | Timezone. |
23+| `-e MEMCACHED_CACHE_SIZE=64MB` | Determines the size of the cache. |
24+| `-e MEMCACHED_MAX_CONNECTIONS=1024` | Determines the maximum number of concurrent connections. |
25+| `-e MEMCACHED_THREADS=4` | Determines the number of threads to process requests. |
26+| `-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. |
27+| `-e MEMCACHED_USERNAME` | Define a new user. If this option is passed a password is needed to authenticate the new user. |
28+| `-p 11211` | Memcached is exposed inside the container on port `11211`. |
29
30 #### Testing/Debugging
31
32@@ -42,10 +44,32 @@ In case you need to debug what it is happening with the container you can run `d
33 $ docker exec -it <name_of_the_container> /bin/bash
34 ```
35
36+<details>
37+ <summary>You can access the memcached instance with telnet from another container (click to expand).</summary>
38+
39+```sh
40+# Run an interactive container with the latest Ubuntu
41+$ docker run -it --rm --name telnet --network app-net ubuntu bash
42+# Install the telnet cli from within the container
43+> apt update && apt install telnet -y
44+# Connect to the memcached instance using telnet
45+> telnet memcached 11211
46+Trying 172.30.0.2...
47+Connected to memcached.
48+Escape character is '^]'.
49+```
50+From there you can run `memcached` commands, as documented in [their wiki](https://github.com/memcached/memcached/wiki/Commands).
51+
52+</details>
53+
54+```sh
55+$ telnet memcached 11211
56+```
57+
58 There are cases where one might want to pass some memcached command line flags that are not configurable via environment variables. In this case you can pass the flags themselves or a shell script:
59
60 ```
61-$ docker run -d --name memcached --network net squeakywheel/memcached:edge <flags_or_script_with_flags>
62+$ docker run -d squeakywheel/memcached:edge <flags_or_script_with_flags>
63 ```
64
65 ### Deploy with Kubernetes
66@@ -59,7 +83,6 @@ $ microk8s enable dns storage
67
68 Use the sample deployment yaml provided [here](https://git.launchpad.net/~canonical-server/ubuntu-server-oci/+git/memcached/plain/examples/memcached-deployment.yml).
69
70-
71 <details>
72 <summary>Apply the `memcached-deployment.yml` (click to expand)</summary>
73

Subscribers

People subscribed via source and target branches