Skip to main content
Your container cannot reach the internet when it runs. Every file your code needs, such as price curves, weather data, lookup tables, or model weights, must be inside the image when it is built. Building the image has full network access, so this is where you download data and install packages.

Why there is no network

Your results stay reproducible

A published version of your function is an immutable image. Once v1.2.1 is pushed, its code and its data never change. Every model that runs v1.2.1 runs exactly that code against exactly that data, today and in five years. If the container downloaded its data on every run, that promise would break in two ways:
  • Unstable runs. When the upstream site is slow, down, rate-limiting, or has moved the file, your model fails, even though nothing in your model changed.
  • Numbers that change on their own. When the upstream source publishes a revised file, the same model with the same inputs silently produces different results. Nobody can reproduce last month’s numbers or explain why they moved.
The platform can also reuse a recent result when a function runs again with the same image and the same inputs. That is only correct because the image and the inputs fully determine the result.

Your code and your data stay isolated

Container functions run your code on shared infrastructure, next to other organizations’ work. Each run is sandboxed:
  • No network. No internet, no internal Aire Labs services, no other customers’ containers. This is fixed and cannot be turned on.
  • Read-only filesystem, except for /tmp.
  • Memory, CPU, and time limits for each run.
The only way in or out is the input and output JSON files. Even code you did not write, such as a dependency several levels down, cannot send your model’s inputs anywhere.

Bundle files in your repository

The simplest approach: commit the files and copy them into the image. Both example repositories do this with a data/ folder:
COPY . /app in the Dockerfile copies data/ into the image. Read files relative to your code, not to the working directory:
If the data comes from a public source, keep a small script that downloads it, run it on your own machine, and commit what it writes. The download happens when you choose, and you review the diff before it ships:
This works well for files up to tens of megabytes. For larger files, download them during the build instead.

Download remote data during docker build

docker build has network access, so the Dockerfile can fetch a file from a remote source and store it in the image. Pin the file’s SHA-256 checksum. If the upstream file changes, the build fails instead of silently changing your numbers.

A single file: ADD --checksum

Dockerfile
Get the checksum by downloading the file once:
If the file no longer matches, the build stops with digest mismatch. Download it again, check what changed, update the checksum, and publish a new version.

Archives and multiple files: RUN

For a zip or tarball, or several files, download and verify them in a RUN step:
Dockerfile
curl and unzip must be in your base image. Add them with apt-get install if they are not.

Data that needs credentials

If the source needs an API key or token, pass it as a build secret, not a build argument or an environment variable. A build secret is available only to the one RUN step that mounts it and is not stored in the image:
Dockerfile
In the publishing workflow, store the token as a repository secret. Expose it to the build step with env: DATA_TOKEN: ${{ secrets.DATA_TOKEN }}, and add the same --secret id=data_token,env=DATA_TOKEN flag to its docker buildx build command. See the Docker build secrets guide.
Anything your Dockerfile writes into the image ships with it. That includes everything a COPY picks up, such as a .env file. Build secrets are the exception: they are never written to the image. Add files you don’t want shipped to .dockerignore.

Packages

Install language packages in the Dockerfile, never at runtime. In Python, list them in pyproject.toml and lock them with uv lock. In R, use install.packages() in a RUN step, or renv to lock versions. Code that tries to install a package at runtime fails, because there is no network.

Updating the data: publish a new version

To use newer data, update the files or the checksum and publish a new version, for example v1.2.2. Models pinned to v1.2.1 keep producing the same results. Switch a block to v1.2.2 when you want that model to use the new data. Treat a new dataset exactly like new code. Registry tags are immutable, so you cannot change what an existing version contains.

Test without network locally

Run your container with --network none to reproduce the platform’s sandbox on your machine. Code that still tries to reach the network fails here instead of in your model: