PHP uygulamalarını Docker ile çalıştırmak
‘15
Berat Doğanberatdgan gmail.com
beratdganberatdogan
Sanallaştırma
“Container” Sanallaştırması
VMs vs. Containers
LXC Nasıl Mümkün Olabiliyor?
namespaces
cgroups
farklı işlem, kullanıcı, ağ ağaçlarını mümkün kılıyor
işlemci, bellek, disk i/o yönetimi
≠LXC Docker
Docker neler sunuyor?
Engine Hub/Registry Compose
Machine Swarm Kitematic
Docker 101root@phpkonf:~# docker run hello-worldUnable to find image 'hello-world:latest' locally latest: Pulling from hello-world … Status: Downloaded newer image for hello-world:latest
Hello from Docker. This message shows that your installation appears to be working correctly.
To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash
root@phpkonf:~# docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS f912ea95c1b0 hello-world "/hello" 8 minutes ago Exited (0) 8 minutes ago
Docker 1001root@phpkonf:~# echo '<?php echo "Hello World!";' > index.php
root@phpkonf:~# docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 10cd4a32778b php:latest "php index.php" A minute ago Exited (0) 13 seconds ago randomnameee
root@phpkonf:~# docker run -v “$PWD":/code -w /code php:latest php index.phpHello World
Container Linkleme
Dockerfile# Yorum satırı KOMUT parametre [parametre parametre]
FROM, MAINTAINER, RUN, CMD, EXPOSE, ENV, ADD, COPY, ENTRYPOINT, VOLUME, WORKDIR
CounterStrike Server ^^
Docker Compose (Fig)
Elegan bir YAML sintaksa sahip.
Multi-container’dan oluşan uygulamaları yönetmemizi kolaylaştırıyor.
Eskiden adı Fig olan bir proje olarak başlamıştı. Tutunca Docker satın aldı. :$
DemoLaravel uygulamasını “Dockerize” edip,
çalıştırmak.
Sorular?