Getting Started with Docker
#
KeyDB Open Source docker imagesYou can find the docker repository here: https://hub.docker.com/r/eqalpha/keydb
If you need a brushup on any of the docker commands you can check out dockers documentation here
#
Start a KeyDB instanceYou can also run simply with docker run eqalpha/keydb
. The above command simply specifies a name to the container and that it is 'detached' or runs in the background.
#
Pass configuration parameters to KeyDB on boot:Make sure you specify the program you are running (keydb-server) for which to modify the parameters for. Next specify the config parameter you would like to modify when starting the container with --parameter-name value
.
You can see the full set of configuration options here
#
Bind portIf you want to bind the container to the node/machine so it is accessible externally pass the parameter -p 6379:6379
#
If you would like to use your own config fileIf you are using your own config file remember to comment out "bind 127.0.0.1", change "protected-mode" from yes to no.
you can grab a copy of the default config file off our github page and modify as you see fit.
#
SymlinksAs requested by users for Redis compatibility, we have included symbolic links for both redis-cli and redis.conf so they are linked to keydb-cli and keydb.conf respectively.
#
Start with persistent storageThis enables data to be saved every second. Read up more about AOF configuration options here to modify persistence options further.
If persistence is enabled, data is stored in the VOLUME /data
, which can be used with --volumes-from some-volume-container
or -v /docker/host/dir:/data
(see docs.docker volumes).
#
Connect to it from an application#
Or connect via keydb-cli (also compatible with redis-cli)you can grab the ip of the container with docker inspect --format '{{ .NetworkSettings.IPAddress }}' mycontainername
then run the following:
alternatively you can link to it
#
Nightly build:If you keep up to date with KeyDB and want to check out features in the making prior to an official release, you can pull with the unstable tags. This will grab the latest version (automatically updated daily at 4am Eastern). These tags are for x86-64 (amd-64) only.
Pull the latest image with docker pull eqalpha/keydb:unstable