Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The right way depends on where the container runs. For standalone Docker on an EC2 instance, attach and mount the EBS volume on the host, then bind-mount that host directory into the container. For Amazon ECS, configure an EBS task volume and map it to a container path. For Amazon EKS, use Kubernetes persistent volumes with the Amazon EBS CSI driver. These are different storage workflows, not interchangeable Docker commands.

Choose the storage workflow for your container platform

Where the workload runs How the EBS volume reaches the container What to check
Docker directly on EC2 Attach EBS to the EC2 instance, mount its filesystem on the host, then bind-mount the host path into the container. Attaching the volume and mounting the host path are separate steps; Docker does not attach an AWS volume.
Amazon ECS Configure an ECS EBS task volume, then map it to a container path with a mount point. Launch type and platform support, IAM role, volume and snapshot requirements, and file permissions.
Amazon EKS Use a Kubernetes persistent volume backed by the Amazon EBS CSI driver. Driver installation and IAM permissions; EBS volumes cannot be mounted to Fargate Pods in this workflow.

Decide who should manage attachment and volume lifecycle before choosing a configuration: the EC2 host operator, ECS, or Kubernetes through the CSI driver.

Attach EBS to a container running directly on EC2

Prepare the volume on the EC2 host

First attach the EBS volume to the EC2 instance and mount a filesystem on the host. The host mount directory is the source path Docker will expose. The correct device and filesystem steps depend on the instance operating system and device mapping, so use the EC2 instructions for that specific environment rather than assuming a device name or copying a generic disk-formatting command.

Bind-mount the host directory into the container

Once the host path is mounted, Docker can expose it at a path inside the container. For example, the form docker run -v /host/path:/container/path maps the host directory at /host/path to /container/path in the container. Replace both paths with the actual mount directory and application path. This bind mount exposes an existing host path; it does not create, attach, or format an EBS volume.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
UGREEN USB-C M.2 NVMe SSD Enclosure for Mac mini,10Gbps
  • 10Gbps NVMe Enclosure: With the latest USB 3.2 Gen2, this M.2 enclosure can achieve a data transfer rate of 10Gbps. Backward compatible with USB 3.1 and USB 3.0. Note: 10G speeds need to be matched with a USB C 3.2 GEN2 data cable
  • Tool-free SSD Enclosure: Tool-free NVMe SSD enclosure for quick and easy installation. Plug and play, no drivers required. The buckle design of the M.2 SSD enclosure can ensure stable and fast transfer
  • Broad Compatibility: The UGREEN M.2 NVMe SSD enclosure is specially designed to support NMVe protocol M/B&M keys and for 2230/ 2242/ 2260/2280 size SSDs up to 8TB. The M.2 NVMe enclosure is applicable for Windows, Mac OS, Linux, Android, IOS systems.(Does not support SATA NGFF SSD or mSATA SSD)
  • Security & Stability: USB C NVMe enclosure adopts advanced RTL9210 chip with short-circuit, over-current and multi-protection to ensure the safety of your SSD and valuable data, and supports UASP/ Trim with high transfer speed
  • Compact & Portable: This ultra-slim aluminium external NVMe enclosure with extra silicone case is portable yet durable, and much easier to carry with this M.2 to USB adapter, making it ideal for travelling

Keep the host and container paths distinct in your configuration. A bind mount can make host data available to the container, but the data lifecycle depends on the host and container arrangement. Do not treat a container-local path or an ephemeral task mount as durable EBS storage unless the backing volume and its lifecycle are configured accordingly.

Configure an EBS volume for an Amazon ECS task

Check ECS support and prerequisites

AWS documents ECS task EBS volumes for Linux Fargate platform version 1.4.0 or later and for EC2 tasks on Nitro-based instances using ECS-optimized AMIs. The documented feature supports at most one new EBS volume per task. To start with existing data, configure the new volume from a snapshot rather than assuming an existing volume can be attached through this workflow.

Rank #2
SABRENT 2.5in SATA to USB 3.0 Tool-Free SSD/HDD Enclosure (EC-UASP)
  • Tool free design, easy to install,Transfer Rates Up to 480 Mbps when connected to a USB 2.0 port,Transfer Rates Up to 5 Gbps when connected to a USB 3.0 port.
  • Suitable for 2.5” SATA/SSD;Supports Standard Notebook 2.5″ SATA and SATA II Hard drives
  • Optimized for SSD, Supports UASP SATA III,Backwards-Compatible with USB 2.0 or 1.1
  • Hot-swappable, plug and play, no drivers needed
  • Operating System:Supported Operating Systems:Mac,Windows;Supported Windows Versions :Windows 7, Windows 8, Windows Vista, Windows XP; Supported Mac Versions: Mac OS X and Higher

For volume configuration at deployment, an ECS infrastructure IAM role is required. For ECS services, the deployment controller must be supported by the EBS integration. Check the current ECS requirements for the selected launch type, Region, and deployment path, because supported configuration fields and platform capabilities may change.

Define the volume and its container mount

  1. Configure the task or service deployment’s EBS volume. Use the ECS volume configuration for the deployment path you are using. ECS manages attachment for this task-level integration.
  2. Add a container mount point. Set its sourceVolume to the configured task volume and its containerPath to the directory where the application should access the data.
  3. Check access from the container. Confirm that the application runs with file-system permissions that allow the required reads and writes. Validate the intended mount path, UID/GID, and whether the mount should be read-only.
  4. Confirm the data lifecycle. Determine how the deployment handles the volume and its data when tasks are replaced or stopped before relying on it for persistent application state.

The task definition’s mount point maps the configured volume into the container, but exact supported fields vary by deployment path. Follow the current ECS volume configuration reference for the syntax you need rather than adapting an older Docker volume-driver example.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
SABRENT Tool-Free NVMe & SATA M.2 SSD Enclosure, USB 3.2 Type-C (EC-SNVE)
  • ENCLOSURE ONLY, SSD NOT INCLUDED: This is the case you put your own M.2 SSD into, not a drive with storage inside. 100% tool-free, so the SSD installs and comes out in seconds with no screwdriver.
  • FITS M.2 NVMe AND SATA: Works with both M.2 PCIe NVMe and M.2 SATA SSDs in 2242, 2260 and 2280 lengths. Bare drives only, no room for a drive with a pre-installed heatsink. It does NOT take 2.5in SATA drives or mSATA.
  • 10GBPS USB 3.2 TYPE-C: Up to 10Gbps, and up to 1000MB/s in real transfers. Backward compatible with USB 3.1 and USB 3.0 at their own speed limits. Bus powered, no drivers and no external power supply.
  • SLIM ALUMINUM BUILD: Ultra-slim aluminum case with an ABS frame, with a thermal pad to move heat off the drive. Light enough to live in a laptop bag, solid enough to survive it.
  • IN THE BOX: Enclosure, 8in Type-C to Type-C cable and user manual. Works with Windows 7 or later, macOS 10.5 or later and Linux. Register on the manufacturer's website for extended warranty service.

Use EBS-backed persistent storage on Amazon EKS

For EKS, use Kubernetes storage resources with the Amazon EBS CSI driver; docker run -v is not the cluster-level configuration mechanism. The driver integrates EBS volume lifecycle with Kubernetes persistent volumes. AWS recommends installing the driver as an EKS add-on and documents the IAM setup needed for it to manage storage.

  1. Install and configure the EBS CSI driver. Use the EKS add-on guidance and complete the documented IAM prerequisites.
  2. Configure Kubernetes storage resources. Use the driver’s supported persistent-volume workflow for the workload and map the resulting storage into the Pod as required.
  3. Check the runtime. EBS volumes cannot be mounted to Fargate Pods under this workflow; verify that the Pod’s execution environment supports the storage configuration.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check permissions and persistence before relying on the mount

A successful attachment does not guarantee that the application can write to the mounted filesystem. Confirm that the container’s user and group have the needed access, that the mount is not configured read-only unintentionally, and that the application is writing to the mounted path rather than another directory in its container filesystem.

Best Value
Sale
BENFEI 2.5 Inch SATA to USB Tool Free External Hard Drive Enclosure, USB Type-C/Type-A to Sata Compatible for 2.5 Inch SSD(Optimized for SSD, Support UASP)
  • Feature - BENFEI Type-C/Type-A 2.5 inch Hard Drive Enclosure easily hook up your 2.5 inch SATA I/II/III hard drive to transfer files from one PC to another PC, laptop, PS4 or as a USB external hard drive.
  • Speed - Up to 5 Gbps data transfer rate with supports UASP SATA III transmission protocol, which is 70% faster than traditional USB3.0. Backward compatible with USB 2.0 or 1.1 ports.
  • Design - With USB Type-C/Type-A plug design, provide a easy connection option to laptop/phone/pad. Tool free installation, Plug & Play, No driver needed for this SATA enclosure. Just push out the cover, plug in the drive, close the cover and go. Hot-Swappable.
  • Compatibility - BENFEI Hard Drive Enclosure supports Windows, LINUX, MacOS 8.0, and above. Specifically designed for 7/9.5mm thick, 2.5 inches, 6TB HDD & SSD. Compatible with Western Digital, Seagate, Toshiba, Samsung, Kingston, Crucial, Hitachi, and more.
  • Warranty - Exclusive BENFEI Unconditional 18-month Warranty ensures long-time protection of your purchase; Friendly and easy-to-reach customer service to solve your problems timely.
Rank #4
Sale
SABRENT USB-C NVMe Enclosure & Reader, M.2 PCIe SSD, 10Gbps (EC-PNVO)
  • Flip-Open Tool-Free Design: Open the cover, insert your NVMe SSD, lock it in place, and close—no screws or tools required. Fast and simple for upgrades, cloning, troubleshooting, and portable tech work.
  • Cooler 10Gbps Performance: The aluminum enclosure presses the thermal pad directly against your SSD for better heat transfer and more stable 10Gbps speeds than slide-in enclosures. Ideal for long transfers and heavy workloads.
  • NVMe Only for Maximum Speed: Supports M.2 NVMe SSDs in sizes 2230, 2242, 2260, and 2280 up to at least 8TB. Not compatible with M.2 SATA SSDs.
  • USB C Plug-and-Play: Connect with USB C for up to 10Gbps using USB 3.2 Gen 2. No drivers or external power needed. Works with laptops, desktops, gaming handhelds, and USB C devices.
  • Portable and Durable Aluminum Build: Reinforced ABS frame with an aluminum alloy top keeps your SSD protected and cool. Slim, lightweight, and perfect for creators, gamers, and anyone needing fast portable storage.
  • Verify which component owns volume attachment: the EC2 host operator, ECS, or the Kubernetes CSI driver.
  • Confirm that the volume is mounted at the expected host or container path.
  • Test read and write access using the same user identity as the application.
  • Check what happens to the volume and its data when a container, task, or Pod is replaced.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.