powershell Comandos de docker

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell Comandos de docker相关的知识,希望对你有一定的参考价值。

PS C:\Users\Docker> docker --version
Docker version 17.03.0-ce, build 60ccb22

PS C:\Users\Docker> docker-compose --version
docker-compose version 1.11.2, build dfed245

PS C:\Users\Docker> docker-machine --version
docker-machine version 0.10.0, build 76ed2a6

docker ps

docker run hello-world

docker run -it ubuntu bash

#Part 1
docker build -t friendlyname .  # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname  # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname         # Same thing, but in detached mode
docker container ls                                # List all running containers
docker container ls -a             # List all containers, even those not running
docker container stop <hash>           # Gracefully stop the specified container
docker container kill <hash>         # Force shutdown of the specified container
docker container rm <hash>        # Remove specified container from this machine
docker container rm $(docker container ls -a -q)         # Remove all containers
docker image ls -a                             # List all images on this machine
docker image rm <image id>            # Remove specified image from this machine
docker image rm $(docker image ls -a -q)   # Remove all images from this machine
docker login             # Log in this CLI session using your Docker credentials
docker tag <image> username/repository:tag  # Tag <image> for upload to registry
docker push username/repository:tag            # Upload tagged image to registry
docker run username/repository:tag                   # Run image from a registry

#Part 3
docker stack ls              # List all running applications on this Docker host
docker stack deploy -c <composefile> <appname>  # Run the specified Compose file
docker stack services <appname>       # List the services associated with an app
docker stack ps <appname>   # List the running containers associated with an app
docker stack rm <appname>                             # Tear down an application


#Busqueda
sudo docker ps --filter "status=exited"
sudo docker container ls --filter "status=running"


#Bash
sudo docker exec -i -t NAME /bin/bash

#Docker: Add a restart policy to a container that was already created
docker update --restart=always <container>

#Ver logs
sudo docker logs -f gitlab

#Editar
sudo docker exec -it gitlab vi /etc/gitlab/gitlab.rb

以上是关于powershell Comandos de docker的主要内容,如果未能解决你的问题,请参考以下文章

markdown Comandos para creacion de base de datos

text CHULETA DE COMANDOS

sql Comandos de Oracle

markdown Trucos para linea de comandos

powershell [Manipulandousuários通过PowerShell执行Office 365] Comandos para manipular o Office 365.

ruby Comandos varios para los contadores de Networking