在 WSL上的 Ubuntu 中通过 Docker 来运行 Redis,并在微服务项目中使用redis

通过在 WSL(Windows Subsystem for Linux)上的 Ubuntu 虚拟机中通过 Docker 来运行 Redis,然后再微服务项目中使用redis

以下是步骤:

1. 安装 Docker(如果还未安装)

首先,确保你已经在 WSL 的 Ubuntu 中安装了 Docker。如果没有安装,可以按照以下步骤操作:

sudo apt update
sudo apt install docker.io

然后启动并确保 Docker 自动开机启动:

sudo systemctl start docker
sudo systemctl enable docker

如果你遇到权限问题,可以将当前用户加入 Docker 组:

猜你喜欢

转载自blog.csdn.net/weixin_45056021/article/details/145670885
今日推荐