Base docker image to run a Memcached server
To create the image lastbackend/memcached, execute the following command on the lb-docker-memcached folder:
docker build -t lastbackend/memcached .
Run the following command to start Memcached:
docker run -d -p 11211:11211 lastbackend/memcached
The first time that you run your container, a new random password will be set. To get the password, check the logs of the container by running:
docker logs <CONTAINER_ID>
You will see an output like the following:
----------------------------- MEMCACHED ----------------------------
+-++-+ USERNAME:admin PASSWORD:tf7UNqbAswqJgj463CsalCD3"
| LB |
+-++-+ Please remember to change the above password!
--------------------------------------------------------------------
If you want to use a preset password instead of a random generated one, you can
set the environment variable PASS to your specific password when running the container:
docker run -d -p 11211:11211 -e USER="demo" -e PASS="mypass" lastbackend/memcached
----------------------------- MEMCACHED ----------------------------
+-++-+
| LB | USERNAME:demo PASSWORD:«password»
+-++-+
--------------------------------------------------------------------
In this case, «password» is the password assigned to the «user» user.
If you want to disable password authentication, you can set PASS to **None**
Content type
Image
Digest
sha256:9aca8abf2…
Size
92.6 MB
Last updated
almost 11 years ago
docker pull lastbackend/memcached