Merge ~ubuntu-docker-images/ubuntu-docker-images/+git/redis:docker-network-fix into ~ubuntu-docker-images/ubuntu-docker-images/+git/redis:edge

Proposed by Sergio Durigan Junior
Status: Merged
Merged at revision: 41548a7ceba29f9850227743eabe17829798a6eb
Proposed branch: ~ubuntu-docker-images/ubuntu-docker-images/+git/redis:docker-network-fix
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/redis:edge
Diff against target: 64 lines (+11/-8)
1 file modified
README.md (+11/-8)
Reviewer Review Type Date Requested Status
Valentin Viennot (community) Needs Fixing
Canonical Server Pending
Review via email: mp+393979@code.launchpad.net

Description of the change

Improve creation of dedicated network.

To post a comment you must log in.
Revision history for this message
Valentin Viennot (valentinviennot) :
review: Needs Fixing
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the review. I've addressed the comment, and will merge the branch now.

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 2cee474..a239265 100644
3--- a/README.md
4+++ b/README.md
5@@ -17,20 +17,21 @@
6 ### Docker CLI
7
8 ```sh
9-$ docker network create --driver bridge redis-network
10-$ docker run -d --name redis-container --network redis-network -e TZ=Europe/London -e REDIS_PASSWORD=mypassword squeakywheel/redis:edge
11+$ docker run -d --name redis-container -p 30073:6379 -e TZ=Europe/London -e REDIS_PASSWORD=mypassword squeakywheel/redis:edge
12 ```
13
14+Access your Redis server at `localhost:30073`.
15+
16 #### Parameters
17 | Parameter | Description |
18 |---|---|
19-| `-e TZ=UTC` | Timezone |
20+| `-e TZ=UTC` | Timezone. |
21 | `-e ALLOW_EMPTY_PASSWORD` | Set to `yes` to allow connections to `redis-server` without a password. **This setting is not recommended in production environments**. |
22 | `-e REDIS_PASSWORD` | Set the desired password to be used. |
23 | `-e REDIS_RANDOM_PASSWORD` | Set this variable to `1` if you would like the entrypoint script to generate a random password for you. You will be able to see the generated password in the logs (`docker logs`). |
24-| `-e REDIS_ALLOW_REMOTE_CONNECTIONS=yes` | Set to `no` to disallow remote connections to `redis-server` (i.e., make `redis-server` listen to `127.0.0.1` only.) |
25+| `-e REDIS_ALLOW_REMOTE_CONNECTIONS=yes` | Set to `no` to disallow remote connections to `redis-server` (i.e., make `redis-server` listen to `127.0.0.1` only). |
26 | `-e REDIS_EXTRA_FLAGS` | Specify extra flags to be passed to `redis-server` when initializing it. |
27-| `-p 6079:6379` | Expose redis on `localhost:6079`. |
28+| `-p 30073:6379` | Expose redis on `localhost:30073`. |
29 | `-v /path/to/redis.conf:/etc/redis/redis.conf` | Mount local [configuration file](https://redis.io/topics/config) `redis.conf` (download this [example file](https://git.launchpad.net/~canonical-server/ubuntu-server-oci/+git/redis/plain/examples/config/redis.conf)). |
30
31
32@@ -38,14 +39,16 @@ $ docker run -d --name redis-container --network redis-network -e TZ=Europe/Lond
33
34 In case you need to debug what it is happening with the container you can run `docker logs <name_of_the_container>`. But if you want to get access to an interactive shell run:
35
36-```
37+```sh
38 $ docker exec -it <name_of_the_container> /bin/bash
39 ```
40
41 With this same image, you can launch an interactive container with the `redis-cli` program,
42 and connect to the `redis-server` that is running in the first container.
43
44-```
45+```sh
46+$ docker network create redis-network
47+$ docker network connect redis-network redis-container
48 $ docker run -it --network redis-network --rm squeakywheel/redis:edge redis-cli -h redis-container
49 redis:6379> AUTH mypassword
50 OK
51@@ -54,12 +57,12 @@ PONG
52 redis:6379>
53 ```
54
55-
56 ### Deploy with Kubernetes
57
58 You can use your favorite Kubernetes distribution; if you don't have one, consider [installing MicroK8s](https://microk8s.io/).
59
60 With microk8s running, enable the `dns` and `storage` add-ons:
61+
62 ```sh
63 $ microk8s enable dns storage
64 ```

Subscribers

People subscribed via source and target branches

to all changes: