7, DockerFile Case

 

4, case

Base image (Scratch)
Docker Hub 99% of the image is through the installation and configuration required in the base image software to build out
custom images mycentos
written
Hub default CentOS mirrors what circumstances
are ready to write DockerFile file
myCentOS content DockerFile
build
docker build - t new image name: TAG.
run
docker run -it new image name: TAG 
listed mirrored the change history
docker history image name
CMD / ENTRYPOINT mirror cases
are designated command a container when you start to run
CMD
Dockerfile can have multiple CMD command, but only the last one will work, replace the parameters after the CMD will be run Docker
Case
explain tomcat presentation of
Docker run -it -p 8888: 8080 LS the -l tomcat
EntryPoint 
Docker parameters after the run will be passed as parameters ENTRYPOINT, after the formation of new combinations of commands
Case
made CMD version can query the vessel IP information
crul order to explain
the problem
if we want to display the HTTP header information, you need to add the -i parameter
WHY
IP version information query made ENTROYPOINT container
custom images Tomcat9
mkdir -p / zzyyuse / mydockerfile / tomcat9
in the directory, touch c.txt
the compressed copy jdk tomcat installation and further into the directory
apache-tomcat-9.0.8. tar.gz
the JDK-8u171-Linux-x64.tar.gz
New Dockerfile files in / zzyyuse / mydockerfile / tomcat9 directory
directory content
to build
to build complete
run
Remarks
verification
container volumes in conjunction with the aforementioned test web service test published
general overview of the
web. xml
a.jsp
test
a small sum

Guess you like

Origin www.cnblogs.com/venicid/p/11922378.html