Why there is no network
Your results stay reproducible
A published version of your function is an immutable image. Oncev1.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.
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.
Bundle files in your repository
The simplest approach: commit the files and copy them into the image. Both example repositories do this with adata/ folder:
COPY . /app in the Dockerfile copies data/ into the image. Read files relative to your code, not to the working directory:
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
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 oneRUN step that mounts it and is not stored in the image:
Dockerfile
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.
Packages
Install language packages in the Dockerfile, never at runtime. In Python, list them inpyproject.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 examplev1.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:
