Docker: Download all from nltk in Dockerfile
How would I achieve the following in a Dockerfile:
2 Solutions collect form web for “Docker: Download all from nltk in Dockerfile”
You can build a custom Docker image with everything you need:
FROM python:3.6-slim RUN pip3 install nltk RUN [ "python", "-c", "import nltk; nltk.download('all')" ] ENTRYPOINT python
docker build -t docker-nltk .
docker run -it docker-nltk
If you add your code to the file downloadall.py this Dockerfile does the job on my machine:
FROM python:3 RUN pip install nltk ADD downloadall.py / CMD [ "python", "./downloadall.py" ]
Let me know if it works for you!