# Docker

```bash
#Enter Shell within Container
docker exec -it CONTAINER sh
docker exec -it CONTAINER bash

#Docker Compose Profile
docker compose --profile stack-1 up -d

#Enumerate Running Containers
docker ps

#Create Network
docker network create NETWORKNAME
sudo docker network ls

#Removes offline containers, volumes, networks and images
docker system prune -a

#Remove Dangling Images
docker system prune

#List current images and inspect the current version of image
docker images
docker inspect <IMAGE ID>

#Display volume location
docker volume inspect volumeName

#Check public IP/Gateway
sudo docker exec CONTAINER wget http://ipecho.net/plain -O - -q ; echo

#move files into container
sudo docker cp '/home/ubuntu/madoka/madokamovies/madoka movie 3.mkv' sonarr:'/downloads/movies/Puella Magi Madoka Magica the Movie Part III Rebellion (2013)'

#transfer files to host over SSH
scp "Shutter.2004.1080p.BluRay.x265.hevc.10bit.AAC.5.1-HeVK.mkv" ubuntu@192.168.1.120:/home/ubuntu/shutter

#transfer directory to host over SSH
scp -r "Shutter" ubuntu@192.168.1.120:/home/ubuntu/shutter
```

#### Docker Volume Location:

* /var/lib/docker/volumes/media-stack\_torrent-downloads/\_data

{% embed url="<https://github.com/navilg/media-stack/blob/main/README.md>" %}
Media Stack
{% endembed %}

{% embed url="<https://docs.docker.com/compose/startup-order/>" %}
Depends\_on
{% endembed %}

{% embed url="<https://stackoverflow.com/questions/38096021/docker-volumes-when-updating-the-image>" %}
Docker Volume locations
{% endembed %}

{% embed url="<https://lucascavalare.github.io/2020-03-15-AppArmor_Docker/>" %}
Apparmor
{% endembed %}

{% embed url="<https://labs.iximiuz.com/tutorials/container-networking-from-scratch?x=103>" %}
container networking
{% endembed %}

{% embed url="<https://iximiuz.com/en/posts/iximiuz-labs-story/>" %}
building with docker
{% endembed %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nk0.gitbook.io/dfir/windows/cheat-sheet/docker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
