Giter Site home page Giter Site logo

Comments (2)

michael-grunder avatar michael-grunder commented on July 18, 2024 1

You want to use docker exec not docker run to run keydb-cli inside your running container.

$ docker run --rm --name mycontainername  -p 6381:6379 -d eqalpha/keydb
10cdd9cc34d672c75b39c094924e1f3c889b25973696d6b55ab8452daeddbae3
$ docker run --rm --name mycontainername1  -p 6379:6379 -d eqalpha/keydb
0c236966c2daade388e21380dc3e34f49795d1d3779c3e9f48a3edf8b6923a18

Running instances:

CONTAINER ID   IMAGE           COMMAND                  CREATED         STATUS         PORTS                                       NAMES
0c236966c2da   eqalpha/keydb   "docker-entrypoint.s…"   2 minutes ago   Up 2 minutes   0.0.0.0:6379->6379/tcp, :::6379->6379/tcp   mycontainername1
10cdd9cc34d6   eqalpha/keydb   "docker-entrypoint.s…"   2 minutes ago   Up 2 minutes   0.0.0.0:6381->6379/tcp, :::6381->6379/tcp   mycontainername

And connecting to them:

$ keydb-cli -p 6381 info|grep run_id
run_id:f9a30f414e526625622a94de5fd6500c4b3d10b9
$ docker exec -it mycontainername keydb-cli info|grep run_id
run_id:f9a30f414e526625622a94de5fd6500c4b3d10b9

$ keydb-cli -p 6379 info|grep run_id
run_id:dc9d0470fe9302c7891a188aa7a73c45a3d002c6
$ docker exec -it mycontainername1 keydb-cli info|grep run_id
run_id:dc9d0470fe9302c7891a188aa7a73c45a3d002c6

from keydb.

fishandsheep avatar fishandsheep commented on July 18, 2024

I see. It's true that I don't fully understand docker yet , docker run eqalpha/keydb keydb-cli connects to port 6379 inside the container, or i can connect directly without specifying a port,

[root@10-7-154-170 ~]# docker run -it --rm eqalpha/keydb keydb-cli -h 172.17.0.2 -a mypassword
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Message of the day:
  KeyDB has now joined Snap! See the announcement at:  https://docs.keydb.dev/news

172.17.0.2:6379> set port 6381
OK
[root@10-7-154-170 ~]# keydb-cli -p 6381 -a mypassword
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Message of the day:
  KeyDB has now joined Snap! See the announcement at:  https://docs.keydb.dev/news

127.0.0.1:6381> get port
"6381"

from keydb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.