Phala Network Docs
  • Home
    • 👾Phala Network Docs
  • Overview
    • ⚖️Phala Network
      • 💎Phala Cloud
      • 🥷Dstack
      • 🔐GPU TEE
    • 💎PHA Token
      • 🪙Introduction
      • 👐Delegation
        • Delegate to StakePool
        • What is Vault
        • What is Share
        • WrappedBalances & W-PHA
        • Examples of Delegation
        • Use Phala App to Delegate
        • Estimate Your Reward
      • 🗳️Governance
        • Governance Mechanism
        • Join the Council
        • Voting for Councillors
        • Apply for Project Funding
        • Phala Treasury
        • Phala Governance
        • Setting Up an Account Identity
  • Phala Cloud
    • 🚀Getting Started
      • Create Your Phala Cloud Account
      • Your First CVM Deployment
      • Explore Templates
        • Launch an Eliza Agent
        • Start from Template
    • 🪨TEEs, Attestation & Zero Trust Security
      • Attestation
      • Security Architecture
    • 🥷Phala Cloud User Guides
      • Deploy and Manage CVMs
        • Deploy CVM with Docker Compose
        • Set Secure Environment Variables
        • Deploy Private Docker Image to CVM
        • Debugging and Analyzing Logs
          • Check Logs
          • Private Log Viewer
          • Debug Your Application
        • Application Scaling & Resource Management
        • Upgrade Application
        • Deployment Cheat Sheet
      • Building with TEE
        • Access Your Applications
        • Expose Service Port
        • Setting Up Custom Domain
        • Secure Access Database
        • Create Crypto Wallet
        • Generate Remote Attestation
      • Advanced Deployment Options
        • Deploy CVM with Phala Cloud CLI
        • Deploy CVM with Phala Cloud API
        • Setup a CI/CD Pipeline
    • 🚢Be Production Ready
      • CI/CD Automation
        • Setup a CI/CD Pipeline
      • Production Checklist
      • Troubleshooting Guide
      • Glossary
    • 🔒Use Cases
      • TEE with AI
      • TEE with FHE and MPC
      • TEE with ZK and ZKrollup
    • 📋References
      • Phala Cloud CLI Reference
        • phala
          • auth
          • cvms
          • docker
          • simulator
      • Phala Cloud API & SDKs
        • API Endpoints & Examples
        • SDKs and Integrations
      • Phala Cloud Pricing
    • ❓FAQs
  • Dstack
    • Overview
    • Getting Started
    • Hardware Requirements
    • Design Documents
      • Decentralized Root-of-Trust
      • Key Management Service
      • Zero Trust HTTPs (TLS)
    • Acknowledgement
  • LLM in GPU TEE
    • 👩‍💻Host LLM in GPU TEE
    • 🔐GPU TEE Inference API
    • 🏎️GPU TEE Benchmark
  • Tech Specs
    • ⛓️Blockchain
      • Blockchain Entities
      • Cluster of Workers
      • Secret Key Hierarchy
  • References
    • 🔐Setting Up a Wallet on Phala
      • Acquiring PHA
    • 🌉SubBridge
      • Cross-chain Transfer
      • Supported Assets
      • Asset Integration Guide
      • Technical Details
    • 👷Community Builders
    • 🤹Hackathon Guides
      • ETHGlobal Singapore
      • ETHGlobal San Francisco
      • ETHGlobal Bangkok
    • 🤯Advanced Topics
      • Cross Chain Solutions
      • System Contract and Drivers
      • Run Local Testnet
      • SideVM
    • 🆘Support
      • Available Phala Chains
      • Resource Limits
      • Transaction Costs
      • Compatibility Matrix
      • Block Explorers
      • Faucet
    • ⁉️FAQ
  • Compute Providers
    • 🙃Basic Info
      • Introduction
      • Gemini Tokenomics (Worker Rewards)
      • Budget balancer
      • Staking Mechanism
      • Requirements in Phala
      • Confidence Level & SGX Function
      • Rent Hardware
      • Error Summary
    • 🦿Run Workers on Phala
      • Solo Worker Deployment
      • PRBv3 Deployment
      • Using PRBv3 UI
      • PRB Worker Deployment
      • Switch Workers from Solo to PRB Mode
      • Headers-cache deployment
      • Archive node deployment
    • 🛡️Gatekeeper
      • Collator
      • Gatekeeper
  • Web Directory
    • Discord
    • GitHub
    • Twitter
    • YouTube
    • Forum
    • Medium
    • Telegram
Powered by GitBook
LogoLogo

Participate

  • Compute Providers
  • Node
  • Community
  • About Us

Resources

  • Technical Whitepaper
  • Token Economics
  • Docs
  • GitHub

More

  • Testnet
  • Explorer
  • Careers
  • Responsible Disclosure

COPYRIGHT © 2024 PHALA.LTD ALL RIGHTS RESERVED. May Phala be with you!

On this page
  • Overview
  • Configuration Methods
  • Method 1: Using the Phala Cloud UI
  • Method 2: Using Encrypted Secrets
  • Deploy Private Docker Image with CLI
  • Setting with Phala Cloud API
  • Troubleshooting

Was this helpful?

Edit on GitHub
  1. Phala Cloud
  2. Phala Cloud User Guides
  3. Deploy and Manage CVMs

Deploy Private Docker Image to CVM

PreviousSet Secure Environment VariablesNextDebugging and Analyzing Logs

Last updated 15 days ago

Was this helpful?

Note: This feature requires DStack version 0.3.5 or later

Overview

Phala Cloud enables secure deployment of private Docker images from popular container registries, maintaining confidentiality throughout the deployment process. This capability is essential for organizations with proprietary code or sensitive applications.

Configuration Methods

Method 1: Using the Phala Cloud UI

The most straightforward approach is configuring registry access through the user interface:

  1. Navigate to Advanced Features in the Phala Cloud dashboard

  2. Select Private Container Registry

  3. Enter your registry credentials

  4. Save your configuration

💡 Security Note: All authorization information is protected with end-to-end encryption, ensuring your credentials remain confidential.

Method 2: Using Encrypted Secrets

For automated deployments or enhanced security, you can set registry credentials as encrypted environment variables:

Docker Hub Registry

  • To download images from Docker Registry, you need to set the following encrypted environment variables: DSTACK_DOCKER_USERNAME and DSTACK_DOCKER_PASSWORD.

  • To download images from AWS ECR Private Registry, you need to set the following encrypted environment variables: DSTACK_AWS_ACCESS_KEY_ID, DSTACK_AWS_SECRET_ACCESS_KEY, and DSTACK_AWS_REGION, DSTACK_AWS_ECR_REGISTRY.

Deploy Private Docker Image with CLI

You can deploy images from a private Docker registry by setting the appropriate environment variables.

🔐 DockerHub:

Set these variables:

  • DSTACK_DOCKER_USERNAME – Your DockerHub username (required)

  • DSTACK_DOCKER_PASSWORD – Your DockerHub password or personal access token (required)

  • DSTACK_DOCKER_REGISTRY – Registry URL (optional, defaults to DockerHub)

🔐 AWS ECR:

Set these variables:

  • DSTACK_AWS_ACCESS_KEY_ID – AWS access key (required)

  • DSTACK_AWS_SECRET_ACCESS_KEY – AWS secret key (required)

  • DSTACK_AWS_REGION – AWS region of the ECR (required)

  • DSTACK_AWS_ECR_REGISTRY – Full ECR registry URL (required)

Once set and added to your docker-compose.yml file, the CLI will automatically authenticate and pull your private image securely.

Example compose file that includes the encrypted environment variables to pull the private docker image.

version: '3.8'

services:
  brave-search:
    image: hashwarlock/brave-search-mcp:v0.0.1
    ports:
      - "3000:3000"
    environment:
      - PORT=3000
      - NODE_ENV=production
      - BRAVE_API_KEY=${BRAVE_API_KEY}
      - DSTACK_DOCKER_USERNAME=${DSTACK_DOCKER_USERNAME}
      - DSTACK_DOCKER_PASSWORD=${DSTACK_DOCKER_PASSWORD}
    restart: unless-stopped

Once these are set, run the command:

phala cvms create --name brave-search --compose docker-compose.yml --teepod-id 3 -e .env

You will see a log that will clarify if you are using a private registry or not.

✓ Deleted DSTACK_SIMULATOR_ENDPOINT from current process
⟳ Fetching available TEEPods... ✓
⟳ Getting public key from CVM... ✓
ℹ 🔐 Using public DockerHub registry...
⟳ Encrypting environment variables... ✓
⟳ Creating CVM... ✓
✓ CVM created successfully

╭────────────┬────────────────────────────────────────────────────────────────────────────────────────────╮
├────────────┼────────────────────────────────────────────────────────────────────────────────────────────┤
│ CVM ID     │ 5952                                                                                       │
├────────────┼────────────────────────────────────────────────────────────────────────────────────────────┤
│ Name       │ brave-search                                                                               │
├────────────┼────────────────────────────────────────────────────────────────────────────────────────────┤
│ Status     │ creating                                                                                   │
├────────────┼────────────────────────────────────────────────────────────────────────────────────────────┤
│ App ID     │ app_9292e497bee0f6885df155c79635606c33b9c160                                               │
├────────────┼────────────────────────────────────────────────────────────────────────────────────────────┤
│ App URL    │ https://cloud.phala.network/dashboard/cvms/app_9292e497bee0f6885df155c79635606c33b9c160    │
╰────────────┴────────────────────────────────────────────────────────────────────────────────────────────╯
ℹ 
✓ Your CVM is being created. You can check its status with:
phala cvms get app_9292e497bee0f6885df155c79635606c33b9c160

Setting with Phala Cloud API

When using Phala Cloud API to deploy, you still need to set above environment variables.

Troubleshooting

If you encounter issues with private image deployment:

  1. Verify your credentials are correct and have not expired

  2. Ensure the image exists in the specified registry

  3. Check that your account has pull permissions for the image

  4. Review the CVM logs for detailed error messages

Using a Private Docker Registry with

Check the for more details.

For additional assistance, join our support groups: 🌍 , 🇨🇳 .

🥷
Phala Cloud CLI
Phala Cloud API
Global
Chinese
Private Docker registry configuration