Dockerfile Building a local mirror

Source: Internet
Author: User
Tags commit create directory tag name centos docker run
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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.