Start by creating a CentOS container #docker create CENTOS:CENOS6
Deletes a container. A005304E4E74 (Mirror ID)-F parameter is forced to delete, sometimes dependencies will not remove Docker rmi-f a005304e4e74
View current container: Docker images
If you have the following information: Create the image successfully CentOS CENTOS6 a005304e4e74 weeks ago 203.1 MB
Enter the container:
#docker run-t-I. CENTOS:CENTOS6
Create a directory (if successful, display the following terminal, 061a24a8acca This is the ID of the container) [Root@061a24a8acca/]# mkdir ssh
exits the container [ Root@061a24a8acca/] #exit
commits to the local local library using the commit command,-M is the images information created,--author the specified author, Xixihe/xxoo is the warehouse name and the mirror name, and v1 is the tag name # Docker commit -m= "Message"--author= "Xixihe" 061a24a8acca xixihe/xxoo:v1
then go into the container again to see #docker run-t-I xixihe/xx OO:V1
View Create directory, if successful, does not fail [Root@061a24a8acca/]# LS
creates mirror using Dockerfile #vim/root/dockfile from Xixihe/sqlite3:v1 US ER Root Run yum-y install Lrzsz run touch test.txt && echo "Asfalf" > Abc.txt ENV webapp_port=9090 workdir/op t/entrypoint ["ls"] CMD ["-A", "1"] VOLUME ["/data", "/var/www"] onbuild ADD. /APP/SRC Onbuild RUN echo "on Build excuted" >> onbuild.txt
Build the image, do not ignore the following. . Represents the current Dockerfile current path. That is, the Dockerfile path is pwd /root/dockerfile #docker build-t xixihe/test:v1.
to see if the image was successful Docker images