I'd like to be able to connect directly to the redis
container below:
root $
root $ docker images redis
REPOSITORY TAG IMAGE ID CREATED SIZE
redis alpine bd71e6db4a54 2 weeks ago 32.2MB
redis latest 84c5f6e03bf0 2 weeks ago 104MB
root $
root $ docker run --name rd -d -p 99:99 redis:latest
ac4b8b2b032b2c2911f03fd4f6af649f470620cd29eb566b821e5ce738d9ac11
root $
root $ docker exec -ti --user root rd bash
root@ac4b8b2b032b:/data#
root@ac4b8b2b032b:/data# redis-cli
127.0.0.1:6379>
127.0.0.1:6379> exit
root@ac4b8b2b032b:/data#
root@ac4b8b2b032b:/data# exit
exit
root $
root $ docker network ls
NETWORK ID NAME DRIVER SCOPE
74c94db9195c basexhttpnetwork bridge local
a5efbdf4bc39 bridge bridge local
4b6586d1bc8c frappe_docker_default bridge local
1b875368faa0 helloworld_default bridge local
3bc6659535b4 host host local
e877e399bf78 none null local
root $
root $ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ac4b8b2b032b redis:latest "docker-entrypoint.s…" 6 minutes ago Up 6 minutes 0.0.0.0:99->99/tcp, 6379/tcp rd
root $
using the redis-cli
tool from the host. So I would need to add or attach the rd
(for redis
) container to the bridge driver? Then specify an IP address and port from the host?