---
# System prepended metadata

title: Utils docker scripts

---

# Utils docker scripts

## docker ps - Lista/ordena
```sh=
docker ps --format 'table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Ports}}' | (read -r; printf "%s\n" "$REPLY"; sort -k 2 )
```

## Recriar ambiente
```sh=
docker-compose down -v && 
docker volume prune -f && 
docker system prune -a -f &&
docker-compose pull && 
docker-compose up -d --force-recreate
```

## Apagar imagens não utilizadas (liberar espaço)
```sh=
docker rmi $(docker images -a -q)
```

## Commitar container
```sh=
docker commit {container_name} {image_name}

# Exemplo
docker commit carguerodocker_mssql_1 carguero-mssql-XXXX
```

## Reiniciar traefik
```sh=
docker-compose stop traefik && docker-compose stop api-plataforma && docker-compose up -d traefik
```

# Painel Webhook

## Não está sincronizando
```sh
docker-compose stop rabbitmq && docker-compose start rabbitmq &&
docker-compose stop backoffice-job-webhook && docker-compose start backoffice-job-webhook &&
docker-compose stop api-plataforma-hooks && docker-compose start api-plataforma-hooks
```

