Docker: Download all from nltk in Dockerfile

How would I achieve the following in a Dockerfile:

sudo python
import nltk'all')

  • Building a Dockerfile with Vagrant and the Docker provider: multi-line command chaining returns error
  • docker exec java app background attach logs
  • How to use docker run with a Meteor image?
  • How to watch xvfb session that's inside a docker on remote server from my local browser?
  • Cannot stop container with docker on windows
  • Is it ok to run docker from inside docker?
  • Does Meteor up (MUP) works exactly as Docker Automated Builds?
  • How to sort by name `docker service ls`
  • Docker CD workflow - making docker hosts pull new images and deploy them
  • Connecting to remote activemq instance running on docker container
  • socket failed Too many open files error Docker
  • Docker build leads to “no space left on device” on Windows 10
  • 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;'all')" ]
    ENTRYPOINT python

    Then build:

    docker build -t docker-nltk .

    And run:

    docker run -it docker-nltk

    If you add your code to the file this Dockerfile does the job on my machine:

    FROM python:3
    RUN pip install nltk
    ADD /
    CMD [ "python", "./" ]

    Let me know if it works for you!

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.