0
泊塢窗:Docker version 1.0.1, build 990021a
如何獲取/ etc/profile並將其保存在docker中?
圖像:ubuntu:14.04.2
並命名爲VL
我運行Ubuntu的圖像和寫在/ etc/profile文件:/usr/share/java/mysql.jar
比源吧。
而我提交容器並再次運行它,但我仍然無法回顯$ CLASSPATH。
結果是空白。如何解決?謝謝。
這裏是我的過程
[email protected]:~$ sudo docker run -it vl bash
[email protected]:/# echo $CLASSPATH
<<--nothing
[email protected]:/# source /etc/profile
[email protected]:/# echo $CLASSPATH
:/usr/share/java/mysql.jar
[email protected]:/# exit
exit
[email protected]:~$ sudo docker commit -m="source /etc/profile" -a="changec" 04cfd1909a89 vl
bbb5599e6634ebe694d18fba46f355445f1aa8880b21c22e2d528c022ebf4f84
[email protected]:~$ sudo docker run -it vl bash
[email protected]:/# echo $CLASSPATH
<<--nothing again! why?
[email protected]:/# exit
非常感謝你much.You幫我一個大忙 – changec
@changec:很高興它幫助!我推薦James Turnbull的The Docker Book;它幫助我快速熟悉Docker。 –