Public | Automated Build

Last pushed: 3 months ago
Short Description
CentOS-6 6.9 x86_64 - Memcached.
Full Description


Docker Image including CentOS-6 6.9 x86_64 and Memcached 1.4.

Overview & links

The latest CentOS-6 based release can be pulled from the centos-6 Docker tag. It is recommended to select a specific release tag - the convention is centos-6-1.1.2 or 1.1.2 for the 1.1.2 release tag.

Tags and respective Dockerfile links

Included in the build are the SCL, EPEL and IUS repositories. Installed packages include OpenSSH secure shell, vim-minimal, are installed along with python-setuptools, supervisor and supervisor-stdout.

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}.

If enabling and configuring SSH access, it is by public key authentication and, by default, the Vagrant insecure private key is required.

SSH Alternatives

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:

$ docker exec -it {docker-name-or-id} bash

For cases where access to docker exec is not possible the preferred method is to use Command Keys and the nsenter command.

Quick Example

Run up a container named memcached.pool-1.1.2 from the docker image jdeathe/centos-ssh-memcached on port 11211 of your docker host.

$ docker run -d \
  --name memcached.pool-1.1.2 \
  -p 11211:11211/tcp \

Now you can verify it is initialised and running successfully by inspecting the container's logs.

$ docker logs memcached.pool-1.1.2

To verify the Memcached service status:

$ docker exec -it \
  memcached.pool-1.1.2 \
  memcached-tool localhost stats



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, 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.

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.

Using environment variables

$ docker stop memcached.pool-1.1.2 && \
  docker rm memcached.pool-1.1.2
$ docker run \
  --detach \
  --tty \
  --name memcached.pool-1.1.2 \
  --publish 11211:11211/tcp \

Environment Variables

There are environmental variables available which allows the operator to customise the running container.


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.


Use MEMCACHED_CACHESIZE MB memory max to use for object storage; the default is 64 megabytes.


Use MEMCACHED_MAXCONN max simultaneous connections; the default is 1024.


Use MEMCACHED_OPTIONS to set other memcached options. The default is -U 0 which disables UDP.

Docker Pull Command
Source Repository