1: docker run -d -p 3000:3000 images
这里若在container
内开启localhost:3000
的服务,怎么才能从外部访问呢?浏览器地址是什么?
2:我commit
了一个已经部署好环境的image
,当下次我根据image
run
一个container
,为什么一些shell
还需要source
才能生效,之前已经source
过了。web
服务也需要重新开启。
不是使用Dockerfile
生成的image
.
3:根据Dockerfile
build
成的image
,是不是在run
时会执行内部的ENTRYPOINT
,所以一些服务不需要重新开启。
谢谢!!
天蓬老师2017-04-27 09:03:48
Question 2:
You should just put the operation in the script that is executed when running. The source seems to have to be executed every time it is started. In Linux, files in some locations will be automatically sourced
Question 3:
ENTRYPOINT is executed when the container starts, regardless of whether there is a CMD command. Services and other things are generally started in this script.
我想大声告诉你2017-04-27 09:03:48
The browser address is 127.0.0.1:3000
The source command is a one-time import. It will be removed from the environment variables when you exit the terminal. Next time you start the terminal, re-import it
You can specify any shell command or script for the RUN command of Dockerfile