Skip to content

Instantly share code, notes, and snippets.

@ozlerhakan
Last active September 7, 2022 14:54
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save ozlerhakan/8d01b9115dfd63f7be83360d2370a04a to your computer and use it in GitHub Desktop.
Save ozlerhakan/8d01b9115dfd63f7be83360d2370a04a to your computer and use it in GitHub Desktop.
Docker Kurulum Adımları

Docker Kurulumu

Linux

Linux dağıtımlarında Docker kullanma noktasında aşağıdaki uygun dağıtımın docker dokümantasyonunu takip ederek kurma ve çalıştırma işlemini gerçekleştirebilirsiniz. Linux dağıtımlarının Docker CE bağlantıları:

Örnek docker client ve docker daemon versiyon gösterimi
$ docker version
Client:
 Version:      17.06.1-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   874a737
 Built:        Thu Aug 17 22:51:12 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.06.1-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   874a737
 Built:        Thu Aug 17 22:50:04 2017
 OS/Arch:      linux/amd64
 Experimental: false

Docker Compose aracının örneğin şu an için 1.16.1 olan son versiyonunu aşağıdaki adımları uygulayarak sistemimize kurabiliriz:

$ curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
$ docker-compose -v
docker-compose version 1.16.1, build 6d1ac21

MacOS & Windows

Windows ve MacOS ortamlarında Docker kullanımın yollarını ele alacağız. Docker for Mac ve Windows uygulamaları platform spesifik uygulamalar olmaktadır. Sisteminiz docker-for-mac veya docker-for-win kullanımında yeterli gereksinimlere sahip değilse, işletim sisteminize göre Docker Toolbox adımını uygulayabilirsiniz. Sisteminize Docker Toolbox aracılığıyla docker kullanımı sağlamak için 2 platforma has adımları bulunmaktadır. Docker Toolbox ile birlikte sisteminize docker-ce, docker-machine, docker-compose, docker shell, Kitematic ve VirtualBox kurulacaktır. Kurulmasını istediğiniz araçları kısıtlı olarak seçme imkanına sahip olmaktasınız.

MacOS

HomeBrew Cask kullanarak terminal üzerinden docker kurulabilmektedir.

# docker-toolbox
$ brew cask install docker-toolbox
# docker-for-mac
$ brew cask install docker

Windows

Docker ve diğer bağlantılı araçlar sisteminize sorunsuz yüklenip yüklenmediğini öğrenme adına aşağıdaki adımları uygulayabilirsiniz:

# docker-ce
$ docker version
Client:
 Version:      17.07.0-ce
 API version:  1.31
 Go version:   go1.8.3
 Git commit:   8784753
 Built:        Tue Aug 29 17:41:08 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.07.0-ce
 API version:  1.31 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   8784753
 Built:        Tue Aug 29 17:46:50 2017
 OS/Arch:      linux/amd64
 Experimental: true

$ docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b04784fba78d: Pull complete
Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

# docker-compose
$ docker-compose -v   (1)
docker-compose version 1.16.0, build ea60ca1
  1. docker-compose Windows ve MacOS ortamlarında yukarıdaki adımlar uygulandıktan sonra beraberinde gelmektedir. Linux dağıtımlarında isteğe bağlı olarak indirilmesi gerekmektedir.

Docker for Windows ya da Mac uyumlu olmayan makinelerde docker-machine üzerinden docker kullanımını sağlayabiliriz:

$ docker-machine -v
docker-machine version 0.12.2, build 9371605
$ docker-machine create --driver virtualbox --virtualbox-disk-size 30000 docker-vm
$ docker-machine ls
$ eval $(docker-machine env docker-vm) (1)
$ docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b04784fba78d: Pull complete
Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://cloud.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/
  1. docker-vm hostunu bulunduğumuz shell üzerinde aktif ediyoruz.

ve görünen o ki etkinliğe hazırız, dans :)

Play with Docker (PWD)

PWD, farklı kategorilere göre hazırlanmış docker görevlerini yaparak öğrenebileceğimiz bir platformdur: http://training.play-with-docker.com/

Yardımcı Araçlar

Etkinlik boyunca kullanabileceğimiz yardımcı araçların listesi:

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