Skip to main content

A tool to manage Docker images using S3 storage

Project description

🐳 S3Docker

🎯 Why S3Docker?

Managing Docker images across multiple environments and teams can be challenging:

  • Private registries can be expensive and complex to maintain
  • Manual image transfer is time-consuming and error-prone
  • Version management and rollbacks can be difficult

S3Docker solves these problems by:

  • Using AWS S3 as a cost-effective storage solution
  • Providing simple commands for image management
  • Automatically handling versioning and archiving
  • Supporting multiple configuration profiles for different environments

✨ Features

  • 📦 Simple push/pull commands for Docker images
  • 🔄 Automatic version archiving
  • 📝 Multiple named configuration profiles
  • 📊 Image listing with size and modification info
  • 🧹 Automatic cleanup of temporary files
  • 🔒 Secure AWS credentials management

🚀 Installation

pip install s3docker

📋 Prerequisites

  • Python 3.6 or higher
  • Docker installed and running
  • AWS account with S3 access
  • AWS credentials with the following permissions:
    • s3:PutObject
    • s3:GetObject
    • s3:ListBucket

🛠️ Configuration

Initial Setup

s3docker config

Follow the interactive wizard to configure:

  1. Profile name (e.g., 'prod', 'staging', 'default')
  2. AWS Access Key ID
  3. AWS Secret Access Key
  4. AWS Region (default: us-east-1)
  5. S3 Bucket name
  6. S3 Path prefix (default: docker-images)

Managing Multiple Profiles

List all configured profiles:

s3docker configs

📚 Usage Guide

Pushing Images to S3

# Using default profile
s3docker push myapp:latest

# Using specific profile
s3docker push myapp:latest --to prod

# Replace existing image
s3docker push myapp:latest --replace

# Specify temporary directory
s3docker push myapp:latest --temp /path/to/temp
s3docker push myapp:latest --temp .  # Use current directory

Pulling Images from S3

# Using default profile
s3docker pull myapp:latest

# Using specific profile
s3docker pull myapp:latest --from prod

# Specify temporary directory
s3docker pull myapp:latest --temp /path/to/temp
s3docker pull myapp:latest --temp .  # Use current directory

Listing Available Images

# List images in default profile
s3docker list

# List images in specific profile
s3docker list --from prod

🔧 How It Works

  1. Push Operation:

    • Saves Docker image to temporary tar file
    • If image exists in S3:
      • Moves existing image to archive folder (if --replace not used)
      • Archives include timestamps for version tracking
    • Uploads new image to S3
    • Cleans up temporary files
  2. Pull Operation:

    • Downloads tar file from S3
    • Loads image into Docker
    • Automatically removes temporary files
  3. Configuration Storage:

    • Configs stored in ~/.s3docker/configs.json
    • Separate profiles for different environments
    • Secure credential storage

🌟 Best Practices

  1. Profile Management:

    • Use different profiles for development/staging/production
    • Keep production credentials separate
    • Regular credential rotation
  2. Image Management:

    • Use specific tags instead of 'latest'
    • Utilize --replace flag carefully
    • Regular cleanup of archived versions

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

📝 License

MIT License - feel free to use and modify as needed!

🆘 Support

  • Create an issue for bug reports
  • Feature requests are welcome
  • PRs accepted

🔮 Future Plans

  • Support for image tags listing
  • Bulk upload/download
  • Compression options
  • Image metadata support
  • Integration with CI/CD pipelines

Made with ❤️ for the Docker community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

s3docker-1.1.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

s3docker-1.1.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file s3docker-1.1.1.tar.gz.

File metadata

  • Download URL: s3docker-1.1.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for s3docker-1.1.1.tar.gz
Algorithm Hash digest
SHA256 2c89baec4ca444f79b5f89e7f787f6d18288a88219e110cfbe46279e4d5ddaa0
MD5 9abb196a0365a456443ef91a6d65d864
BLAKE2b-256 da59b922f369e3620072cfcb8cbc1d69f84edf263233b79e711b52cf75476474

See more details on using hashes here.

File details

Details for the file s3docker-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: s3docker-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for s3docker-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6fec81a34478fee7aa235e1e5afb60237dc692e90747bd2942975b55bcf36ab
MD5 c695fe6ef5152b2d5393edf61325e64b
BLAKE2b-256 c1e37bf12a9812b948e32ce96e18d8ab7058663fc3d63808f6b5975ba4dbe42b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page