Add more Docker commands

This commit is contained in:
James Skemp 2023-08-20 16:12:40 -05:00
parent 3ff1bdb160
commit 2ad3571346
1 changed files with 20 additions and 6 deletions

View File

@ -37,11 +37,25 @@ docker ps -a
docker start <container-id>
docker start <container-name>
# Stop a container with a <container-id> or <container-name>.
docker stop <container-id>
docker stop <container-name>
# Stop a container.
docker stop <container>
# Restart a container.
docker restart <container>
# Remove/delete a container.
docker rm <container>
# View container's logs.
docker logs <container>
```
## Working with Running Containers
```bash
docker cp path/to/file <container>:./destination/path/
# Run bash on the container, if installed.
docker exec -it <container> bash
```
# Remove a container with a <container-id> or <container-name>.
docker rm <container-id>
docker rm <container-name>
```