2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

memcached を docker で触って感覚を掴む

Posted at

その1 memcached イメージを使う

以下のように dockerhub の memcached を使うことで簡単に試すことができる。

$ docker run --name my-memcache -d -p 11211:11211 memcached
e502fab0fe92a15b060df17b2900c09d14d0c3c84a03e6f10f8c8ea3786a54f7

$ telnet localhost 11211
Trying ::1...
Connected to localhost.
Escape character is '^]'.
set hoge 0 100 4
piyo
STORED
get hoge
VALUE hoge 0 4
piyo
END
quit
Connection closed by foreign host.

その2 centos イメージを使う

別の方法として、centos に yum install memcached する場合もメモしておく。

FROM centos:6

RUN yum install -y memcached telnet
$ docker build -t memcached-study .
$ docker run -it --rm --name memcached-study memcached-study bash

# service memcached start
# telnet localhost 11211

以上です。とにかく docker が便利。ありがとうございます。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?