For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
      • AstroFully-managed data operations, powered by Apache Airflow.
      • Astro Private CloudRun Airflow-as-a-service in your environment.
      • Professional ServicesExpert Airflow services for your enterprise's success.
    • Tools
      • Cosmos
      • Orbiter
      • CLI
      • AI SDK
      • Agents
      • Blueprint
      • UpdatesThe State of Airflow 2026See the insights from over 5,800 data practitioners in the full report. Download Now ➔
  • Customers
  • Docs
    • Insights
      • Blog
      • Webinars
      • Resource Library
      • Events
    • Education
      • Academy
      • What is Airflow?
  • Pricing
Get Started Free
    • Astro CLI
    • Quickstart
      • Configure the CLI
      • Use Podman
      • Customize your Dockerfile
      • Authenticate to cloud services
      • Ignore project files
    • CLI reference

Product

  • Platform Overview
  • Astro
  • Astro Observe
  • Astro Private Cloud
  • Security & Trust
  • Pricing

Tools & Services

  • Cosmos
  • Docs
  • Professional Services
  • Product Updates

Use Cases

  • AI Ops
  • Data Observability
  • ETL/ELT
  • ML Ops
  • Operational Analytics
  • All Use Cases

Industries

  • Financial Services
  • Gaming
  • Retail
  • Manufacturing
  • Healthcare
  • All Industries

Resources

  • Academy
  • eBooks & Guides
  • Blog
  • Webinars
  • Events
  • The Data Flowcast Podcast
  • All Resources

Airflow

  • What is Airflow
  • Airflow on Astro
  • Airflow 3.0
  • Airflow Upgrades
  • Airflow Use Cases
  • Airflow 2.x End of Life

Company

  • Our Story
  • Customers
  • Newsroom
  • Careers
  • Contact

Support

  • Knowledge Base
  • Status
  • Contact Support
GitHubYouTubeLinkedInx
  • Legal
  • Privacy
  • Terms of Service
  • Consent Preferences

  • Do Not Sell or Share My Personal information
  • Limit the Use Of My Sensitive Personal Information

Apache Airflow®, Airflow, and the Airflow logo are trademarks of the Apache Software Foundation. Copyright © Astronomer 2026. All rights reserved.

LogoLogo
On this page
  • Prerequisites
  • Use an alternative Astro Runtime distribution
  • Run commands on build
  • Add a CA certificate to an Astro Runtime image
Configure the CLI

Customize your Astro project Dockerfile

Edit this page
Built with

By default, the Astro project Dockerfile only includes a FROM statement that specifies your Astro Runtime version. However, you can extend your Dockerfile to use a different distribution or run additional buildtime arguments. Use this document to learn which Dockerfile customizations are supported both locally and on Astro.

Prerequisites

  • An Astro project

Use an alternative Astro Runtime distribution

Starting with Astro Runtime 9, each version of Astro Runtime has a separate distribution for each currently supported Python version. Use an alternative Python distribution if any of your dependencies require a Python version other than the default Runtime Python version.

Replace <registry-url> with the Docker registry URL. Airflow 2.x-based Runtime versions and Airflow 3.x-based Runtime versions have different registry URLs. See Docker Registry URLs for information on which URL to pull from.

To use a specific Python distribution, update the first line in your Astro project Dockerfile to reference the required distribution:

FROM <registry-url><runtime-version>-python-<python-version>

For example, to use Python 3.10 with Astro Runtime version 9.0.0, you update the first line of your Dockerfile to the following:

FROM <registry-url>9.0.0-python-3.10

Run commands on build

To run additional commands as your Astro project is built into a Docker image, add them to your Dockerfile as RUN commands. These commands run as the last step in the image build process.

Replace <registry-url> with the Docker registry URL. Airflow 2.x-based Runtime versions and Airflow 3.x-based Runtime versions have different registry URLs. See Docker Registry URLs for information on which URL to pull from.

For example, if you want to run ls when your image builds, your Dockerfile would look like this:

FROM <registry-url>3.1-5
RUN ls

This is supported both on Astro and in the context of local development.

Add a CA certificate to an Astro Runtime image

If you need your Astro Deployment to communicate securely with a remote service using a certificate signed by an untrusted or internal certificate authority (CA), you need to add the CA certificate to the trust store inside your Astro project’s Docker image.

Replace <registry-url> with the Docker registry URL. Airflow 2.x-based Runtime versions and Airflow 3.x-based Runtime versions have different registry URLs. See Docker Registry URLs for information on which URL to pull from.
  1. In your Astro project Dockerfile, add the CA certificate to the base Runtime image:

    1# Use the base Astro Runtime image so we can setup our CA cert before installing any packages
    2FROM <registry-url><runtime-version>-base
    3
    4# Switch to root for setup
    5USER root
    6
    7# Add internal CA certificate
    8COPY <internal-ca.crt> /usr/local/share/ca-certificates/<internal-ca.crt>
    9RUN update-ca-certificates
    10
    11# Install system packages if listed in packages.txt
    12COPY packages.txt .
    13RUN /usr/local/bin/install-system-packages
    14
    15# Install Python dependencies
    16COPY requirements.txt .
    17RUN /usr/local/bin/install-python-dependencies
    18
    19# Switch back to astro user
    20USER astro
    21
    22# Copy project into image
    23COPY --chown=astro:0 . .
    When using a base image, make sure to install the system level and python packages.
  2. (Optional) Add additional COPY statements before the RUN update-ca-certificates stanza for each CA certificate your organization is using for external access.

  3. Restart your local environment or deploy to Astro. See Deploy code.