Use docker run up and enter a container

In everyday use frequently encountered case where the user needs to pack their docker mirrored, then you need to enter inside the container installing various libraries.
How to enter any of the base image, and in which it operates?

  • Start docker docker container and into the mirror
    command is as follows:
docker run -it containerId /bin/bash

After entering the container, often also need to test the contents of the local machine to the container inside the
command as follows:

docker cp ./filename containerId:/usr/local

After completion of the installation user, and verify the normal environment, it can be written back to the step in the DockerFile. kill off the container, back to the initial state, it can be pleasant to use docker build the generated image.
Specific command is as follows:

docker build -t imageName:tag .

Guess you like

Origin www.cnblogs.com/mrnx2004/p/11691156.html