Skip to main content
Mount Archil into a container when you need data that survives individual container lifetimes, or if you need to share data across multiple containers. Containers, unlike regular Linux servers, require special permissions in order to mount external file systems. The best way to mount Archil into a container depends on the platform that you’re using and the permissions that you have:
  • Local docker containers support mounting Archil if they are started with --privileged, or mount to the host machine and add Archil to your container as a Docker volume.
  • Kubernetes pods support mounting Archil via the CSI driver, follow instructions to install and use the CSI driver on K8s deployments
  • Cloud container platforms (such as AWS Lambda, ECS Fargate, or Modal container sandboxes) often do not support mounting Archil because they do not give users sufficient permission to mount external file systems. For these users, we recommend using Serverless execution to send code that needs the disk to Archil directly.
  • Cloud sandboxes (such as Daytona, E2B, and Modal VM sandboxes) often support mounting Archil directly. Consult your provider’s documentation for the best way to mount Archil.
The remainder of this article is about how to mount into a local Docker container.

Mounting into a privileged container

You can easily mount an Archil disk into a privileged container, because it has full access to the host’s Linux kernel, and has permissions to mount external file systems. These steps are the same as mounting on a regular Linux machine.
1

Add the client to your Dockerfile

Add the following lines to your Dockerfile to automatically install the Archil CLI to mount Archil disks, and create the folder where you plan to mount Archil.
2

Start your privileged container

Start your container with the --privileged flag to give your container permission to mount external file systems.
3

Authorize your server

Each container that connects to the Archil disk needs to be authorized. You can managed which servers are authorized in the Archil console, by navigating to the disk that you want to use, then selecting Connections in the left-bar, and clicking Add User to authorize a new server.Select Disk Token, and save the token somewhere you can retrieve it, you will not be able to see it again.
4

Mount the disk

Using the token that you just saved from the console, you can now mount the disk with archil mount.

Mounting as a Docker volume

1

Mount your disk to the host

Follow the instructions for either mounting to Linux or mounting to macOS to mount your Archil disk to the host running docker.For example, for Linux, assuming you have the Archil CLI installed:
2

Run your container

Once your disk is mounted to the host, you can run your container with the docker run command, using the --volume flag to bind-mount the disk to the container.