How to flush all of the cached contents of Docker memcached? How to flush all of the cached contents of Docker memcached? docker docker

How to flush all of the cached contents of Docker memcached?


Assuming that you have the memcahed port 11211 exposed. You can flush the cache via either telnet or nc and sending flush_all

echo flush_all | nc localhost 11211OK

You can replace localhost, with the machine hostname if you are not executing the command on the same machine where the container is running.


docker exec -it $MEMCACHE_CONTAINER_ID bash -c "echo flush_all > /dev/tcp/localhost/11211"