You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 2, 2024. It is now read-only.
This build uses the base image [jdeathe/centos-ssh](https://github.com/jdeathe/centos-ssh) so inherits it's features but with `sshd` disabled by default. [Supervisor](http://supervisord.org/) is used to start the [`memcached`](https://github.com/memcached/memcached/wiki) daemon when a docker container based on this image is run.
10
9
11
-
The latest CentOS-6 / CentOS-7 based releases can be pulled from the `centos-6` / `centos-7` Docker tags respectively. For production use it is recommended to select a specific release tag - the convention is `centos-6-1.3.1` OR `1.3.1` for the [1.3.1](https://github.com/jdeathe/centos-ssh-memcached/tree/1.3.1) release tag and `centos-7-2.2.1` OR `2.2.1` for the [2.2.1](https://github.com/jdeathe/centos-ssh/tree/2.2.1) release tag.
Included in the build are the [SCL](https://www.softwarecollections.org/), [EPEL](http://fedoraproject.org/wiki/EPEL) and [IUS](https://ius.io) repositories. Installed packages include [OpenSSH](http://www.openssh.com/portable.html) secure shell, [vim-minimal](http://www.vim.org/), are installed along with python-setuptools, [supervisor](http://supervisord.org/) and [supervisor-stdout](https://github.com/coderanger/supervisor-stdout).
19
-
20
-
Supervisor is used to start the memcached (and optionally the sshd) daemon when a docker container based on this image is run. To enable simple viewing of stdout for the service's subprocess, supervisor-stdout is included. This allows you to see output from the supervisord controlled subprocesses with `docker logs {docker-container-name}`.
21
-
22
-
If enabling and configuring SSH access, it is by public key authentication and, by default, the [Vagrant](http://www.vagrantup.com/)[insecure private key](https://github.com/mitchellh/vagrant/blob/master/keys/vagrant) is required.
23
-
24
-
### SSH Alternatives
25
-
26
-
SSH is not required in order to access a terminal for the running container. The simplest method is to use the docker exec command to run bash (or sh) as follows:
27
-
28
-
```
29
-
$ docker exec -it {docker-name-or-id} bash
30
-
```
31
-
32
-
For cases where access to docker exec is not possible the preferred method is to use Command Keys and the nsenter command.
33
-
34
-
## Quick Example
17
+
> For production use, it is recommended to select a specific release tag as shown in the examples.
35
18
36
19
Run up a container named `memcached.1` from the docker image `jdeathe/centos-ssh-memcached` on port 11211 of your docker host.
37
20
@@ -43,13 +26,20 @@ $ docker run -d \
43
26
jdeathe/centos-ssh-memcached:2.2.1
44
27
```
45
28
46
-
Now you can verify it is initialised and running successfully by inspecting the container's logs.
29
+
Verify the named container's process status and health.
30
+
31
+
```
32
+
$ docker ps -a \
33
+
-f "name=memcached.1"
34
+
```
35
+
36
+
Verify successful initiallisation of the named container.
47
37
48
38
```
49
39
$ docker logs memcached.1
50
40
```
51
41
52
-
To verify the Memcached service status:
42
+
Verify the status of the `memcached` service that's running in the named container.
53
43
54
44
```
55
45
$ docker exec -it \
@@ -61,18 +51,19 @@ $ docker exec -it \
61
51
62
52
### Running
63
53
64
-
To run the a docker container from this image you can use the standard docker commands. Alternatively, if you have a checkout of the [source repository](https://github.com/jdeathe/centos-ssh-memcached), and have make installed the Makefile provides targets to build, install, start, stop etc. where environment variables can be used to configure the container options and set custom docker run parameters.
54
+
To run the a docker container from this image you can use the standard docker commands as shown in the example below. Alternatively, there's a [docker-compose](https://github.com/jdeathe/centos-ssh-memcached/blob/centos-7/docker-compose.yml) example.
65
55
66
-
In the following example the memcached service is bound to port 11211 of the docker host. Also, the environment variable `MEMCACHED_CACHESIZE` has been used to set up a 32M memory based storage instead of the default 64M.
56
+
For production use, it is recommended to select a specific release tag as shown in the examples.
67
57
68
58
#### Using environment variables
69
59
60
+
In the following example the `memcached` service is bound to port `11211` of the docker host. Also, the environment variable `MEMCACHED_CACHESIZE` has been used to set up a 32M memory based storage instead of the default 64M.
61
+
70
62
```
71
63
$ docker stop memcached.1 && \
72
-
docker rm memcached.1
73
-
$ docker run \
64
+
docker rm memcached.1 && \
65
+
docker run \
74
66
--detach \
75
-
--tty \
76
67
--name memcached.1 \
77
68
--publish 11211:11211/tcp \
78
69
--sysctl "net.core.somaxconn=1024" \
@@ -82,22 +73,22 @@ $ docker run \
82
73
jdeathe/centos-ssh-memcached:2.2.1
83
74
```
84
75
85
-
####Environment Variables
76
+
### Environment variables
86
77
87
-
There are environmental variables available which allows the operator to customise the running container.
78
+
Environment variables are available, as detailed below, to allow the operator to configure a container on run. Environment variable values cannot be changed after running the container; it's a one-shot type setting. If you need to change a value you have to terminate, (i.e stop and remove), and replace the running container.
88
79
89
-
#####MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER
80
+
#### MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER
90
81
91
82
It may be desirable to prevent the startup of the memcached-wrapper script. For example, when using an image built from this Dockerfile as the source for another Dockerfile you could disable memcached from startup by setting `MEMCACHED_AUTOSTART_MEMCACHED_WRAPPER` to `false`. The benefit of this is to reduce the number of running processes in the final container. Another use for this would be to make use of the packages installed in the image such as `memcached-tool` or the libmemcached tools `memcp`, `memcat`, `memrm` and `memflush`; effectively making the container a Memcached client.
92
83
93
-
#####MEMCACHED_CACHESIZE
84
+
#### MEMCACHED_CACHESIZE
94
85
95
86
Use `MEMCACHED_CACHESIZE` MB memory max to use for object storage; the default is 64 megabytes.
96
87
97
-
#####MEMCACHED_MAXCONN
88
+
#### MEMCACHED_MAXCONN
98
89
99
90
Use `MEMCACHED_MAXCONN` max simultaneous connections; the default is 1024.
100
91
101
-
#####MEMCACHED_OPTIONS
92
+
#### MEMCACHED_OPTIONS
102
93
103
94
Use `MEMCACHED_OPTIONS` to set other memcached options. The default is `-U 0` which disables UDP.
0 commit comments