How to create a docker volume, push to ECR, and attach that volume to a container

Really struggling to find high quality information on what I would think would be a common scenario.

Say I have a bunch of data here:


I want to create a docker volume:

docker volume create foo

I want to copy the hefty-data to the volume:

docker cp /home/me/hefty-data foo:/hefty  # how to copy data to the volume?

I want to push that volume to ECR. And I want to pull the volume from ECR. (Not sure how to do either). And then to run a container I want to use that volume:

docker run -v foo/hefty:/hefty

My code above is not quite right, because all the examples online on how to connect a volume to a container suck, I am afraid. Anybody know how to do this? The reason is because hefty-data is 1.5 gigs and it doesn’t need to be in container builds – it can be reused by containers etc (read-only etc).

Source: StackOverflow