0
泊塢代碼
# Import Ubuntu image to Docker
docker pull ubuntu:16.04
docker run -it ubuntu:16.04
# Instsall Python3 and pip3
apt-get update
apt-get install -y python3 python3-pip
# Install Selenium
pip3 install selenium
# Install BeautifulSoup4
pip3 install beautifulsoup4
# Install library for PhantomJS
apt-get install -y wget libfontconfig
# Downloading and installing binary
mkdir -p /home/root/src && cd &_
tar jxvf phantomjs-2.1.1-linux-x86_64.tar.bz2
cd phantomjs-2.1.1-linux-x86_64/bin/
cp phantomjs /usr/local/bin/
# Installing font
apt-get install -y fonts-nanum*
問題
我試圖導入Ubuntu的形象泊塢窗並安裝serveral的包inscluding python3,PIP3,BS4和PhantomJs。然後我想將所有這些配置保存在Docker中作爲「ubuntu-phantomjs」。由於我目前在Ubuntu映像上,任何以「docker」命令開頭的內容都不起作用。我怎樣才能保存我的圖像?如何我在Ubuntu鏡像安裝保存到碼頭工人