Check the available versions of Redis

docker search redis
Copy the code

2. Obtain the latest Redis image

docker pull redis:latest
Copy the code

3. View the local mirror

docker images
Copy the code

4. Run the container

docker run -itd --name redis-test -p 6379:6379 redis
Copy the code

Check the container

docker ps
Copy the code

6. Enter the container

docker exec -it redis-test /bin/bash
Copy the code