Docker built environment --- commonly used commands

Commonly used commands:

docker If you want to remove the mirror, now stop Container
docker PS inquiry mirror running
docker stop + containerid
stop and then delete
docker images to view mirror
docker rmi + image id specified mirror delete
delete all mirrored
docker rmi `docker images -q`

Connect to our docker host
docker-machine ssh default
view file path
into the docker host, that is, the terminal displays docker @ default: ~ $ circumstances, enter the command
mount
into the shared directory
cd / filename
ls view the directory of files and folders

docker deployment of micro-services
start to go with docker toolbox is our host -> docker host -> container
create the container:
Ensure that the host docker

Administrator Login: sudo passwd
sudo su enter administrator mode
execute build command:. Docker build -t second
to create a file
touch
create a file directory
mkdir
to delete the file
rm- file name

Copy files
cp / docker_use / Dockerfile.
#Docker_use shared folder path is copied to the current directory.
Added two IP
ifconfig eth1: 0 192.168.99.10 Netmask 255.255.255.0 up
// Step 2: Run containers, designated IP, here examples of open container SSH service, take it back test
root @ default: ~ # docker run -d -p 192.168.99.10:222:22 --name ssh1 gudaoxuri / scala-2.11-env
query is run to hang the container
docker ps -a
delete container
docker rm container id
a key stop all container
docker stop $ (docker ps -q)
to delete the folder
rm -rf folder name of
a key to remove all containers
docker rm $ (docker ps -aq)
run-time image
docker run - d -p 8000: 8000 mirror name or id
view of the container running log
docker logs -f id
returned to the host crtl + z

 

Guess you like

Origin www.cnblogs.com/wdzhz/p/10973313.html