我正在嘗試使用python 3和nltk tokenizer創建一個Docker容器。任何人都可以幫助我創建Dockerfile。如何創建在Ubuntu容器中安裝Python 3和nltk的Dockerfile?
回答
你可以開始你Dockerfile這樣的:
FROM python:3-wheezy
RUN apt-get update && apt-get install -y git ca-certificates
RUN pip install -q nltk
#optionally your other docker commands here
然後生成並運行容器。
觀測數據:這是一個正式的Debian基於容器(與Ubuntu兼容),如果你喜歡一個純粹的Ubuntu的容器代替「巨蟒:3喘息」與從ubuntu14
標題說「ubuntu」和這個dockerfile是debian –
非常感謝你 – Ankur100
建「dominga/uwsgi-python3」這裏有一個Dockerfile
其通過python3-nltk
Debian軟件包安裝nltk
(並且證明它確實有效)
FROM ubuntu:xenial
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3-nltk && \
rm -rf /var/lib/apt/lists/*
CMD ["python3", "-c", "import nltk"]
注意,apt-get
樣板,建議在the dockerfile best practices
非常感謝。我會試試看。 – Ankur100
- 1. 在Ubuntu中安裝EPT python NLTK
- 2. Ubuntu dockerfile - mailutils安裝
- 3. Django的安裝失敗runnung dockerfile在Ubuntu
- 4. 如何安裝Graphlab創建在Ubuntu?
- 5. Ubuntu:如何安裝flex來創建postgres?
- 6. 如何爲Ubuntu創建安裝程序
- 7. 如何在Ubuntu 12.04中安裝python-matplotlib?
- 8. 如何在Ubuntu中安裝Oauth2.0 for python
- 9. 在Ubuntu中創建安裝包
- 10. Ubuntu - Python安裝
- 11. 如何在Ubuntu上安裝Python的Tktable?
- 12. 如何安裝Python 3,如果我想在Ubuntu
- 13. 如何在Dockerfile中運行bower安裝?
- 14. 如何在ubuntu中創建sh文件的安裝程序
- 15. 安裝NLTK時出錯Python
- 16. 如何使用dockerfile安裝ruby和bundler?
- 17. 錯誤從Dockerfile建立與單聲道的Ubuntu鏡像安裝
- 18. 如何在Ubuntu中安裝Lex和Yacc?
- 19. ubuntu中的Python pip安裝
- 20. 如何在Ubuntu 16.04上安裝python-gasp?
- 21. 在dockerfile中安裝mysql?
- 22. 在Dockerfile中安裝節點?
- 23. Dockerfile - 創建dockerfile
- 24. 如何安裝在Ubuntu
- 25. 讓Openshift 3容器安裝numpy和scipy
- 26. Dockerfile:在Dockerfile建設過程中創建和構建
- 27. Python 3:如何安裝pygame?
- 28. 如何安裝python 3
- 29. 在安裝Python 3後安裝Python 2.7
- 30. 在Ubuntu中安裝rails 3 11.04
發佈您正在嘗試的dockerfile文件 – flamusdiu
anaconda環境比docker更穩定。而且你還需要爲'nltk_data'做一些卷裝。 Docker容器並不是使用NLTK的最佳選擇。 – alvas