How to push a shared volume or shared image to ECR

783 Views Asked by At

Right now I have this in a Dockerfile:

ENV NLTK_DATA /nltk_data
RUN python3 -m nltk.downloader -d /nltk_data all

this Python library has several gigs of data. I don't know need an extra 5 GBs in each Docker image I publish to Amazon ECR. Is there some way to push a shared image to ECR that containers can reference when they run?

I want to do something like:

docker pull ecr-url/shared-image:latest
docker run -v shared-image:/nltk_data:/nltk_data my-image

basically, I don't see why it would be necessary to run the shared-image as a container, I just need the data from it. However, according to this answer: https://stackoverflow.com/a/34093828/1223975

it says:

Unfortunately there doesn't seem to be a way to copy files directly from Docker images. You need to create a container first and then copy the file from the container.

0

There are 0 best solutions below