Skip to content

Instantly share code, notes, and snippets.

@ssatz
Last active January 7, 2019 08:10
Show Gist options
  • Save ssatz/81b734713066f8fc05d5187de3853022 to your computer and use it in GitHub Desktop.
Save ssatz/81b734713066f8fc05d5187de3853022 to your computer and use it in GitHub Desktop.
Docker command
# Command Description
docker ps #List containers
docker pull #Pull an image or a repository from a registry
docker push # Push an image or a repository to a registry
docker rename #Rename a container
docker system prune # prune This will remove:
# - all stopped containers
# - all volumes not used by at least one container
# - all networks not used by at least one container
# - all images without at least one container associated to them
# recreate only 2 services
$ docker-compose up -d --no-deps SERVICE1 SERVICE2
#create a external network
docker network create nginx-proxy
#docker-compoer
docker-compose up -d
#docker stop and remove
docker container stop $(docker container ls -a -q) && docker system prune -a -f --volumes
docker-compose down --rmi all
#docker Interative command
docker-compose exec redis sh
docker-compose exec web sh
@ssatz
Copy link
Author

ssatz commented Oct 13, 2018

docker exec -it [container-name] php artisan Send:Newsletter

@ssatz
Copy link
Author

ssatz commented Oct 18, 2018

docker network ls
docker network connect <network_name> <container_name>
docker inspect <network_name>

@ssatz
Copy link
Author

ssatz commented Dec 12, 2018

to resolve redis memory allocate issue run on the host system

sysctl vm.overcommit_memory=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment