Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Filter by Categories
About Article
Analyze Data
Archive
Best Practices
Better Outputs
Blog
Code Optimization
Code Quality
Command Line
Daily tips
Dashboard
Data Analysis & Manipulation
Data Engineer
Data Visualization
DataFrame
Delta Lake
DevOps
DuckDB
Environment Management
Feature Engineer
Git
Jupyter Notebook
LLM
LLM Tools
Machine Learning
Machine Learning & AI
Machine Learning Tools
Manage Data
MLOps
Natural Language Processing
NumPy
Pandas
Polars
PySpark
Python Helpers
Python Tips
Python Utilities
Scrape Data
SQL
Testing
Time Series
Tools
Visualization
Visualization & Reporting
Workflow & Automation
Workflow Automation

Unregistry: Skip the Registry, Deploy Docker Images Directly

Table of Contents

Unregistry: Skip the Registry, Deploy Docker Images Directly

Table of Contents

The Registry Problem

Docker deployments create two pain points: expensive private registries and wasteful transfers.

Teams choose between costly Docker Hub subscriptions or public code exposure. Meanwhile, small code changes trigger multi-gigabyte transfers of unchanged layers.

# Resource-heavy deployment cycle
docker push ml-model:latest  # 2GB upload for model tweaks
ssh server "docker pull ml-model:latest"  # 2GB download of unchanged ML libraries

These methods transfer complete images regardless of what changed. A small code update forces you to move gigabytes of unchanged base layers.

Introduction to Unregistry

Unregistry eliminates registry overhead by transferring images directly between Docker hosts. It creates a temporary registry on the target server and transfers only the missing layers over SSH.

Install unregistry as a Docker CLI plugin:

# macOS/Linux via Homebrew
brew install psviderski/tap/docker-pussh

# Create Docker CLI plugin symlink
mkdir -p ~/.docker/cli-plugins
ln -sf $(brew --prefix)/bin/docker-pussh ~/.docker/cli-plugins/docker-pussh

Smart Transfers: Only Changed Parts

Traditional Docker Hub workflows push entire images regardless of changes. A 2GB ML model with a small code tweak still transfers all layers, wasting bandwidth and time.

Unregistry analyzes Docker image layers and transfers only what’s missing on the target server. Instead of pushing entire multi-gigabyte images, it sends only the changed layers, dramatically reducing bandwidth usage and deployment time.

No Registry Infrastructure Required

Docker Hub subscriptions cost teams hundreds monthly for private repositories. Private registry infrastructure requires dedicated servers, maintenance, and security management.

Unregistry eliminates these costs entirely by working without intermediate storage. You deploy directly from your development machine to production servers, bypassing registry infrastructure completely.

Works with Existing SSH Connections

Registry deployments require API keys, service accounts, and firewall configurations

Unregistry uses your existing SSH keys and server access. No additional setup needed.

Faster Deployments via Deduplication

Subsequent deployments become incredibly fast since unchanged base layers already exist on the target server. A small code change doesn’t require transferring the entire Python runtime or ML libraries again.

Setup and Installation

Set up unregistry for direct Docker deployments by ensuring your target server meets the requirements:

Server Requirements:

  • Docker installed and running
  • SSH user has docker permissions (in docker group or uses sudo)
  • Internet access to pull unregistry image on first use

Local Requirements:

  • Docker CLI with plugin support (19.03+)
  • SSH client configured for target server

Verify the installation works:

# Test the plugin installation
docker pussh --help

Output:

Usage: docker pussh [OPTIONS] IMAGE DESTINATION

Push docker images directly to remote servers without an external registry

Arguments:
  IMAGE        Docker image to push
  DESTINATION  Remote server (user@host[:port])

Options:

  -i, --identity-file <PATH>    SSH private key file
      --platform <PLATFORM>    Target platform for multi-platform images
  -h, --help                   Print help

Building a Docker Application

Create a simple Streamlit application that demonstrates data visualization:

# app.py
import streamlit as st
import pandas as pd
import numpy as np

st.title("Unregistry Demo App")
st.write("This Streamlit app demonstrates direct Docker deployment")

# Sample data visualization
chart_data = pd.DataFrame(
    np.random.randn(20, 3),
    columns=['A', 'B', 'C']
)

st.line_chart(chart_data)
st.write("Deployed without registry overhead!")

Define the required dependencies:

streamlit==1.28.1
pandas==2.1.3
numpy==1.24.3

Configure the Docker container for the Streamlit app:

FROM python:3.11-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY app.py .
EXPOSE 8501

CMD ["streamlit", "run", "app.py", "--server.address", "0.0.0.0"]

Build the application:

docker build -t demo-app:latest .
Sending build context to Docker daemon  3.584kB
Step 1/6 : FROM python:3.11-slim
 ---> f4c2c1c2d8a1
Step 2/6 : WORKDIR /app
 ---> Using cache
 ---> 8d9a4c5b6e2f
Step 3/6 : COPY requirements.txt .
 ---> b7e3f8a9d1c4
Step 4/6 : RUN pip install -r requirements.txt
 ---> Running in 3a2b5c7d8e9f
Successfully installed streamlit-1.28.1 pandas-2.1.3 numpy-1.24.3
 ---> 9f1e4d2c5b8a
Step 5/6 : COPY app.py .
 ---> 4b7a8e1f9c3d
Step 6/6 : CMD ["streamlit", "run", "app.py", "--server.address", "0.0.0.0"]
 ---> Running in 6e8f2a4b9d1c
 ---> 2d5c8f1a7e9b
Successfully built 2d5c8f1a7e9b
Successfully tagged demo-app:latest

Deployment Workflow

Deploy your application using unregistry’s efficient transfer process:

# Direct deployment to production server
docker pussh demo-app:latest deploy@prod-server

# Use SSH config for simplified commands
docker pussh demo-app:latest prod-server  # Uses ~/.ssh/config

# Deploy with specific SSH key (common in CI/CD)
docker pussh demo-app:latest ubuntu@192.168.1.100 -i ~/.ssh/deploy_key

The deployment process creates a temporary registry on the target server, transfers only missing layers, and cleans up automatically. Your image becomes available immediately on the remote Docker daemon.

For modern dependency management that eliminates traditional complexity, see our UV Python Package Manager guide.

Production Use Cases

Unregistry works well for several deployment scenarios where registry overhead creates friction:

Direct Production Deployment:

Build locally, deploy directly to production servers without intermediate registries.

# Build for production platform
docker build --platform linux/amd64 -t demo-app:1.2.3 .

# Deploy directly to production
docker pussh demo-app:1.2.3 deploy@prod-server

# Start the Streamlit service
ssh deploy@prod-server "docker run -d -p 8501:8501 demo-app:1.2.3"

CI/CD Pipeline Integration:

Integrate unregistry into your CI/CD pipeline for seamless deployment.

# GitHub Actions example
- name: Deploy to staging
  run: |
    docker build -t demo-app:${{ github.sha }} .
    docker pussh demo-app:${{ github.sha }} deploy@staging-server

📚 For comprehensive CI/CD practices and production workflow best practices, check out Production-Ready Data Science.

Conclusion

Unregistry simplifies ML model deployments by eliminating registry complexity. It transfers only missing layers over SSH, making model updates faster and reducing infrastructure overhead for data science teams.

This approach works best for direct model deployments where registry management creates unnecessary complexity during the research-to-production workflow.

Leave a Comment

Your email address will not be published. Required fields are marked *

0
    0
    Your Cart
    Your cart is empty
    Scroll to Top

    Work with Khuyen Tran

    Work with Khuyen Tran