Skip to content

Instantly share code, notes, and snippets.

@Talhafayyaz11
Last active February 1, 2024 13:09
Show Gist options
  • Save Talhafayyaz11/8919feeca850f9478245f4bdba83b2bc to your computer and use it in GitHub Desktop.
Save Talhafayyaz11/8919feeca850f9478245f4bdba83b2bc to your computer and use it in GitHub Desktop.
Docker
DOCKER COMMANDS:
1. List all docker containers
- COMMAND: docker ps -a
2. Docker logs
- COMMANDS: docker logs [OPTIONS] CONTAINER
3. To remove all docker containers:
- COMMAND: docker system prune -a --volumes
- WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all volumes not used by at least one container
- all images without at least one container associated to them
- all build cache
4. Get into docker container
- COMMAND: docker exec -it <container name> /bin/bash
5. Paste files to docker container
- COMMAND: docker cp <src-path> <container>:<dest-path>
6. Copy files from docker container
- COMMAND: docker cp <container>:<src-path> <local-dest-path>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment