Redis in Docker on Linux Container

Source: Internet
Author: User
Tags docker hub docker run

Record: Running a Redis instance in Docker
When we install Docker in the Windows system, a Linux virtual machine is automatically created in Hyper-V, and if this VM is not running, it means that Windows Container is currently running, and we can switch to Linux Container, on the small whale icon right-→switch to Linux Containers, this time the virtual machine in Hyper-V will start.
Pull the official Redis image from the Docker hub first

Docker Pull Redis

After the pull is complete, view all current mirrors

Docker images

Create a Reids container because I have already installed the Redis port is 6379, so the Redis in the container maps to my machine when I choose 6380

Docker Run-p 6380:6379-d Redis

Start a Redis interactive container to connect to a Redis instance

Docker run-it Redis redis-cli-h 172.17.0.2

The IP address can be viewed through the inspect command, and we'll set up the Redis instance's Requirepass

We can run multiple containers, as long as the port mapped to the local does not conflict.

Redis in Docker on Linux Container

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.