Can you run Redis on Windows using Docker?
Asked Answered
A

2

10

I know that Redis is not supported for Windows (at least newer versions).

My question is can I somehow use official builds of Redis on Windows using a Docker container? since Docker suppose to provide a compatible predictable environment for every platform

Admittedly answered 17/1, 2022 at 18:7 Comment(1)
Just to be clear, Docker doesn't let you run Linux on Windows and vice versa. But WSL2 on Windows runs a Linux VM where you can run Linux programs.Nope
A
7

In short, you can run this

docker run --name redis -d -p 6379:6379 redis:6.0

Your applications will be able to access Redis on localhost:6379

Check this post, if you want a detailed explanation on installing a persisting redis deployment using Volume mounts. link

For more info, check the official docs link

Audition answered 17/1, 2022 at 18:18 Comment(1)
Exactly what I needed! The -d flag detaches the console from the container. The -p flag binds a port from the container to the host. In this example, we're binding the host port 6379 to the container port 6379.Inference
C
2

You can either use redis via the WSL or use this image built natively for docker Windows. There is the latest version officially ported by Microsoft as well as the latest versions ported by the community.

Example of a docker command :

docker run --name my-redis -p 6379:6379 -d redis:5.0.14.1-lts-nanoserver-1809
Cytotaxonomy answered 12/4, 2022 at 8:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.