# Docker

### INSTALL

```
sudo apt-get update

sudo apt-get install  apt-transport-https  ca-certificates  curl  gnupg2  software-properties-common

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 

sudo apt-get update

Eger pubkey hatasi verirse asagidaki komutu kullan!
    - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <KEY>
    - sudo apt-get install docker-ce docker-ce-cli containerd.io
```

### synopsis

*\** imagelar için önce locale bakar. bulamaz ise dockerhub'dan çeker. yani pull etmeden run edebiliriz direk.

* Hello world!
* docker version
* docker pull hello-world
* docker images
* docker run  -d -> terminali detach et.
* docker ps -> çalisan containerlar
* docker ps -a -> çalisan ve duran history
* docker inspect 89c6f2ca8ba1 -> daha detayli sonuçlar
* docker start -a e139e975009f -> tekrar baslatmak için. -a attach demek.
* docker logs  -> detached olan containerlarin çiktilari görmek için.
* docker rm  ile container sileriz. -f ile çalisir durumda da olsa siler. \*"docker stop " durdurur.
* docker rmi&#x20;
* docker -p xport:yport images:ver.v -> -p xport:yport = hostun xportundan gelen istegi dockerin yportuna yönlendir.
* docker exec -it  /bin/bash -> -i interactiv -t terminal attach et.

### DOCKER COMPOSE

```
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 

sudo chmod +x /usr/local/bin/docker-compose
```


---

# 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://security.musana.net/docker/untitled.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.
