Redis Docker Official Image

repository·master·Indexed 22 days ago

https://github.com/redis/docker-library-redis

Build definitions and source for the official Docker Redis image maintained by the Docker Community. Includes instructions for updating versions, generating Dockerfiles and metadata via scripts, and testing image builds locally.

Tokens
631
Snippets
1
Records
3
Agent score
29%

What's inside docker-library-redis

  1. Overview of the Redis Docker Official Image

    master

    This repository contains the source code for the Docker 'Official Image' for redis.

    Important Distinctions:

    • This is the Docker Official Image, maintained by the Docker Community, not the image provided directly by the upstream Redis project.
    • For full usage instructions, configuration details, and API information, refer to the Redis Docker Hub page.
    • Detailed image descriptions are maintained in the docker-library/docs repository.
  2. Test the Redis image build locally

    master

    After generating the Dockerfiles, you can verify the build locally by following these steps:

    1. Navigate to the version directory: Change directory to the specific version and base image flavor you wish to test (e.g., cd ./7.4/debian).
    2. Build the image: Use docker build with a custom tag.
    3. Run the container: Start the container in detached mode.
    4. Verify with redis-cli: Execute redis-cli inside the running container to ensure the service is operational.
    # 1. Navigate to the version/flavor directory
    cd ./7.4/debian
    
    # 2. Build the image
    docker build -t redis-test:7.4-rc1 .
    
    # 3. Run the image
    docker run --name test-7-4-rc1 -d redis-test:7.4-rc1
    
    # 4. Open redis-cli inside the container
    docker exec -it test-7-4-rc1 redis-cli
  3. Prepare Docker files and metadata for Redis images

    master

    To prepare the repository for building new Redis images, follow these steps to update versions and generate the necessary Dockerfiles and metadata:

    1. Install dependencies: Ensure wget, jq, and bashbrew are installed on your system.
    2. Update versions: Run versions.sh to regenerate versions.json. This script fetches the latest Redis version from the official Redis hashes repository. If the version is not automatically detected, you can manually edit versions.json.
    3. Apply templates: Run apply-templates.sh to process the versions. This creates new version directories named by the major.minor Redis version (e.g., 7.4/), each containing its own Dockerfile.
    4. Generate metadata: Run generate-stackbrew-library.sh. This automates the creation of metadata for the images, including tags, architectures, and git commit hashes, ensuring they align with versions.json.