ubuntu/memcached

Verified Publisher

By Canonical

Updated 3 months ago

Memcached, in-memory keyvalue store for small data chunks. Long-term tracks maintained by Canonical.

Image
Databases & Storage

50K+

Memcached | Ubuntu

Current Memcached Docker Image from Canonical, based on Ubuntu. Receives security updates and tracks the newest combination of Memcached and Ubuntu. This repository is free to use and exempted from per-user rate limits.

About Memcached

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.

Tags and Architectures

LTS Up to 5 years free security maintenance on LTS channels.

ESM Up to 10 years customer security maintenance from canonical/memcached. Request access.

Tags in italics are not available in ubuntu/memcached but are shown here for completeness.

Channel TagCurrentlyArchitectures
1.6-22.04_betaMemcached 1.6 on Ubuntu 22.04 LTSamd64, arm64, ppc64el, s390x
1.5-20.04_betaLTSMemcached 1.5.22 on Ubuntu 20.04 LTSamd64, arm64, ppc64el, s390x
track_risk

Channel Tag shows the most stable channel for that track. A track is a combination of both the application version and the underlying Ubuntu series, eg 1.0-22.04. Channels are ordered from the most stable to the least stable, candidate, beta, edge. More risky channels are always implicitly available. So if beta is listed, you can also pull edge. If candidate is listed, you can pull beta and edge. When stable is listed, all four are available. Images are guaranteed to progress through the sequence edge, beta, candidate before stable.

Commercial use and Extended Security Maintenance channels

If your usage includes commercial redistribution or requires unavailable channels/versions, please get in touch with the Canonical team (or using rocks@canonical.com).

Usage

Launch this image locally:

docker run -d --name memcached-container -e TZ=UTC  ubuntu/memcached:1.6-22.04_beta

Parameters

ParameterDescription
-e TZ=UTCTimezone.
-e MEMCACHED_CACHE_SIZE=64MBDetermines the size of the cache.
-e MEMCACHED_MAX_CONNECTIONS=1024Determines the maximum number of concurrent connections.
-e MEMCACHED_THREADS=4Determines the number of threads to process requests.
-e MEMCACHED_PASSWORDDefine 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.
-e MEMCACHED_USERNAMEDefine a new user. If this option is passed a password is needed to authenticate the new user.
-p 11211:11211Memcached is exposed inside the container on port 11211.

Testing/Debugging

To debug the container:

docker logs -f memcached-container

To get an interactive shell:

docker exec -it memcached-container /bin/bash
You can access the Memcached instance with telnet from another container (click to expand).
# Create a dedicated network
$ docker network create memcached-network
# Connect the main container to it
$ docker network connect memcached-network memcached-container
# Run an interactive container with the latest Ubuntu
$ docker run -it --rm --name telnet --network memcached-network ubuntu bash
# Install the telnet cli from within the container
> apt update && apt install telnet -y
# Connect to the memcached instance using telnet
> telnet memcached-container 11211
Trying 172.30.0.2...
Connected to memcached.
Escape character is '^]'.

From there you can run memcached commands, as documented in their wiki.

$ telnet memcached-container 11211

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 append the flags themselves or a shell script to the run command.

Deploy with Kubernetes

Works with any Kubernetes; if you don't have one, we recommend you install MicroK8s and microk8s.enable dns storage then snap alias microk8s.kubectl kubectl.

Download memcached-deployment.yml and set containers.memcached.image in memcached-deployment.yml to your chosen channel tag (e.g. ubuntu/memcached:1.6-22.04_beta), then:

kubectl apply -f memcached-deployment.yml

Memcached will be listening on port 31211 in your host.

Bugs and feature requests

If you find a bug in our image or want to request a specific feature, please file a bug here:

https://bugs.launchpad.net/ubuntu-docker-images/+filebug

Please title the bug "memcached: <issue summary>". Make sure to include the digest of the image you are using, from:

docker images --no-trunc --quiet ubuntu/memcached:<tag>

Deprecated channels & tags

These channels (tags) are not updated anymore. Please upgrade to newer channels, or reach out if you can't upgrade.

TrackVersionEOLUpgrade Path
1.6-21.10Memcached 1.6.9 on Ubuntu 21.10 07/2022 1.6-22.04_beta
1.6-21.04Memcached 1.6.9 on Ubuntu 21.04 01/20221.6-21.10
track

Docker Pull Command

docker pull ubuntu/memcached