Skip to content

Instantly share code, notes, and snippets.

@webarthur
Last active September 7, 2017 23:57
Show Gist options
  • Save webarthur/45d475dbe1d965e802262db8d694c5e6 to your computer and use it in GitHub Desktop.
Save webarthur/45d475dbe1d965e802262db8d694c5e6 to your computer and use it in GitHub Desktop.
Comandos úteis para docker
# lista imagens instaladas
docker images
# remove imagem
docker rmi [ID]
# lista todos os containers criados
docker ps -a
# lista containers ativos
docker ps
# remove container
docker rm [ID]
# inicia conteiner
docker-compose up
# pesquisa por imagens
docker search [nome_da_imagem]
# instala imagem
docker pull [nome_da_imagem]
# remove todos os containers inativos
docker rm $(docker ps -q -f status=exited)
# executa ssh em um container
docker exec -ti [ID] /bin/bash
# remove images <none> (imagens criadas no rebuild de uma imagem)
docker rmi $(docker images -f "dangling=true" -q)
# cria uma imagem baseada no Dockerfile
docker build -t [nome_da_imagem] .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment