Skip to content

Instantly share code, notes, and snippets.

@sefatanam
Last active October 21, 2021 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sefatanam/b650f44164fff6a5ba14505b7a89ca4c to your computer and use it in GitHub Desktop.
Save sefatanam/b650f44164fff6a5ba14505b7a89ca4c to your computer and use it in GitHub Desktop.

Run Redis with docker

Prerequisites

Getting Started

  • Run in your terminal docker run -d --rm --name CacheServer -p 6379:6379 redis , it will provide localhost:6379 as redis connection string.

    Docker Run Command:
    docker container run -d --name [container_name] -p [machine_port]:[container_port] [docker_image]
    Options :

    • -d, –detach: It is used to run the container in the background and print container ID.
    • –name: It is used to specify the name of the container
    • -p, –publish: It is used to publish container’s ports to host

  • Now you are ready to use localhost:6379 to connect with redis server.

  • Open Redis VS Code Extension, Add connection left everything empty test your connection if succeed press Ok create a connection with Redis.


  • If the connection is successfully connected with redis you will see a dialog same as bellow in sidebar.

Redis VS Code Extension Explore in More Detail

Usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment