Skip to content

futuretea/docker-login-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Docker Registry Login Test

A simple and efficient tool to test Docker registry authentication without using the Docker CLI.

Overview

This tool provides a way to verify Docker registry credentials by simulating the Docker login process using the registry's v2 API. It's particularly useful for:

  • Testing Docker registry credentials
  • Debugging authentication issues
  • Validating registry access without Docker CLI
  • Automated credential verification

Features

  • Supports Docker Hub and custom registries
  • Follows Docker v2 authentication flow
  • Secure password handling
  • Clear error messages
  • No Docker daemon required

Prerequisites

  • bash
  • curl
  • jq (for JSON parsing)
  • base64

Installation

  1. Clone this repository:
git clone https://github.com/futuretea/docker-login-test.git
cd docker-login-test
  1. Make the script executable:
chmod +x docker-login-test.sh

Usage

Testing Docker Hub Login

./docker-login-test.sh

Testing Custom Registry Login

./docker-login-test.sh registry.example.com

The script will interactively prompt for:

  • Username
  • Password (input is masked for security)

How It Works

The script implements the Docker v2 authentication flow:

  1. Queries the registry for authentication requirements
  2. Obtains an authentication token using provided credentials
  3. Verifies the token by making an authenticated request

Response Codes

  • 200: Success - Credentials are valid
  • Other codes: Authentication failed (with detailed error message)

Security

  • All registry communication uses HTTPS
  • Passwords are never stored
  • Password input is masked during entry
  • No sensitive data is logged

Troubleshooting

Common issues and solutions:

  1. Connection Issues

    • Verify network connectivity
    • Check if registry is accessible
    • Ensure registry URL is correct
  2. Authentication Failures

    • Verify credentials are correct
    • Check if account is active
    • Ensure you have registry access permissions
  3. Dependencies

    • Verify all required tools are installed
    • Check tool versions if issues persist

Contributing

Contributions are welcome! Please feel free to:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a Pull Request

License

MIT License

Author

futuretea

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.

About

test docker login by curl

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages