Skip to content
All posts
Data Engineering·August 4, 2025·5 min read

Mastering Meltano: How to Build a Docker Image to Run Containerized Meltano Pipelines

Containerize a Meltano EL pipeline with Docker to get a reproducible, self-contained workflow that produces a JSONL artifact.

By Aaron O'Toole

Containerize a Meltano EL pipeline with Docker to get a reproducible, self-contained workflow that produces a JSONL artifact.

Tested on 2026-10-13 with Meltano 4.4.1 and Python 3.12. Every step below was run on that date, and the commands that no longer work on Meltano 4.x have been updated.

Introduction

This guide walks you through containerizing a Meltano EL pipeline with Docker. You’ll initialize a Meltano project, configure a smoke-test extractor and JSONL loader, build a Docker image that embeds the pipeline, run it in a container, and verify the output (animals.jsonl). By the end, you’ll have a working image, a running pipeline, and a tangible JSONL output file to inspect.

What is Docker?

Docker is an open-source container platform that packages applications and their dependencies into isolated environments. A Dockerfile defines how to build an image, the image is the immutable artifact used to launch a container.

In short:

Dockerfile, then Image, then Container

What is Meltano?

Meltano is an open-source, CLI-based ELT platform built on Singer SDK connectors. It gives data engineers the flexibility to run extractors and loaders from the same repository, with configurable schema/catalog options and command arguments to match pipeline requirements.

Prerequisites

Before initializing the Meltano project and building the Docker image, make sure you have the following:

  • Operating System: Windows (with WSL), or a supported Linux distribution.

  • Python: Python 3.10 or newer (Meltano 4 requires 3.10+). On Python 3.9, pipx install meltano gives you the older Meltano 3.9.5 without an error.

  • Git: Meltano installs the smoke-test extractor from its git repository, so git must be installed.

  • pipx and uv package manager:

    Install pipx: on Ubuntu 24.04, python3 -m pip install pipx stops with error: externally-managed-environment. Install pipx from apt instead, then run pipx ensurepath so the tools pipx installs are on your PATH.

  • Install uv:

    Use: pipx install uv

  • Docker Engine

      Both Linux and WSL can run Docker Engine natively.
    
  • Install Meltano:

sudo apt update
sudo apt install -y pipx git
pipx ensurepath
# open a new terminal (or run: source ~/.bashrc)
pipx install uv
pipx install meltano

# or using uv
uv tool install meltano

These installs are unpinned. On 2026-10-13 they gave uv 0.13.0 and Meltano 4.4.1 (pipx 1.4.3 from apt on Ubuntu 24.04), so a later install may get a newer release than the one tested here.

1. Initialize Meltano Project

Start by creating and entering your project directory:

cd /path/to/projects
meltano init meltano-docker-example
cd meltano-docker-example
uv venv
source .venv/bin/activate
which python

Expected output (example):

/path/to/projects/meltano-docker-example/.venv/bin/python

2. Configure Meltano Extractor and Loader

We’ll use the “Smoke Test” extractor and target-jsonl loader.

Add the extractor and loader:

meltano add --plugin-type extractor tap-smoke-test
meltano add --plugin-type loader target-jsonl

Meltano 4 no longer takes the plugin type as a positional argument: meltano add extractor tap-smoke-test fails with Utility 'extractor' is not known to Meltano. Pass the type with --plugin-type, or leave it out and let Meltano detect it (meltano add target-jsonl works too).[1] If the extractor install fails with Git executable not found, install git and run meltano install.

Edit meltano.yml to configure the extractor. meltano add already wrote the entry under plugins:; add the config block to it:

plugins:
  extractors:
  - name: tap-smoke-test
    variant: meltano
    pip_url: git+https://github.com/meltano/tap-smoke-test.git
    config:
      streams:
        - stream_name: animals
          input_filename: https://raw.githubusercontent.com/meltano/tap-smoke-test/main/demo-data/animals-data.jsonl

3. Invoke the Tap and Test the EL Process Locally

Run the extractor:

meltano invoke tap-smoke-test

You should see a line like:

Beginning sync of 'animals' in full_table mode

Then run the full pipeline:

meltano run tap-smoke-test target-jsonl

Inspect the output:

cd output
cat animals.jsonl

Expected sample content:

{"id": 1, "description": "Red-headed woodpecker", "verified": true, "views": 27, "created_at": "2021-09-22T01:01:05Z"}
{"id": 2, "description": "Dragon, Melty", "verified": true, "views": 27, "created_at": "2021-07-01T18:47:52Z"}

Return to project root:

cd ..

4. Configure Docker

Add the Docker bundle:

meltano add --plugin-type files files-docker

Replace the Dockerfile with:

FROM meltano/meltano:latest-python3.12

WORKDIR /project

RUN apt update && \
    apt clean

# Install any additional requirements
COPY ./requirements.txt .
RUN pip install -r requirements.txt

# Copy over Meltano project directory
COPY . .
RUN meltano install

# Prevent runtime modifications
ENV MELTANO_PROJECT_READONLY=1

ENTRYPOINT ["meltano"]
CMD ["run", "tap-smoke-test", "target-jsonl"]

The \ at the end of the RUN line is a single backslash; a doubled \\ breaks the build with unknown instruction: apt. The latest-python3.12 tag moves with each release; on 2026-10-13 it carried Meltano 4.4.1 on Python 3.12.15.

Build the image:

docker build --no-cache -t meltano-docker-example .

Verify the image exists:

docker images

5. Run Meltano in a Docker Container

Execute the container:

docker run meltano-docker-example

On the first run you may see:

[warning] No state was found, complete import.

This is expected, it triggers a full sync.

To inspect output manually, mount your local output/ directory into the container and let the pipeline write animals.jsonl there. Each docker run starts a fresh container from the image, so a second container can’t see the file the first run wrote:

docker run --rm -v "$PWD/output":/project/output meltano-docker-example
cat output/animals.jsonl

Mount only output/, not the whole project: -v "$PWD":/project hides the image’s copy of the project, so you would see the local files from step 3 instead of what the container produced.

Summary

  • Built a Meltano pipeline locally.
  • Created a Docker image containing the Meltano project.
  • Ran a full EL process inside a container.
  • Verified the resulting animals.jsonl output.

Next Steps

  • Use a database as the target (e.g., SQL Server, PostgreSQL, MySQL).
  • Swap in a public API as the extractor.
  • Implement version control (Git) and integrate into CI/CD pipelines.

Get in touch


  1. Meltano documentation, command line interface reference: meltano add (retrieved October 13, 2026). https://docs.meltano.com/reference/command-line-interface ↩︎