demand
Centos mirror their own use Dockerfile build its own custom. Since centos mirror can be used in the definition of vim command (Lite centos mirror is not the vim).
First, to see all the information docker in the mirror. Mirror in FIG no custom cnetos, will use a custom Dockerfile.
Second, create a file Dockerfile
- Create a file called Dockerfile_MyCentos of
touch Dockerfile_MyCentos
- Write the following to the file
# From the parent class mirror the FROM CentOS # declare an environment variable ENV MYPATH / Home default directory # custom into the vessel WORKDIR $ MYPATH # install vim command RUN yum install - the y-vim # vim command output installed successfully RUN echo ----- vim --------- install Success ----------------- # Foreign exposed port eXPOSE 80 CMD / bin / bash
- Use docker bulid order to build a custom centos
docker build -f /home/my-docker-file/Dockerfile_MyCentos -t qizhi/centos:1.0 .
- View custom images
Third, Run and enter the custom images used vim command to test
- Run a custom image
docker run -it 47548c89aee8
- After entering the default path to see if the container changed
- Use vim command to test