1

I have a Docker container on Ubuntu. This container uses a PCIe drive and I want to add a SATA drive. Neither drive should share data with other containers.

How can I do this?

From the command docker run? Or through the Dockerfile?

Here's the lsblk on the server:

# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 744.7G  0 disk
|-sda1        8:1    0   243M  0 part /boot
|-sda2        8:2    0     1K  0 part
|-sda5        8:5    0   976M  0 part
`-sda6        8:6    0 743.5G  0 part /
nvme0n1     259:0    0 349.3G  0 disk
`-nvme0n1p1 259:2    0 349.3G  0 part /media/pcie-disk

Here's the lsblk on the Docker container:

# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 744.7G  0 disk
|-sda1        8:1    0   243M  0 part
|-sda2        8:2    0     1K  0 part
|-sda5        8:5    0   976M  0 part
`-sda6        8:6    0 743.5G  0 part
nvme0n1     259:0    0 349.3G  0 disk
`-nvme0n1p1 259:2    0 349.3G  0 part /etc/hosts
Justin Elkow
  • 2,833
  • 6
  • 28
  • 60

1 Answers1

0

Mount the disk to your host at any endpoint, then mount the endpoint to the Docker container as one of its volumes.

Yuankun
  • 6,875
  • 3
  • 32
  • 34