PHP uygulamalarını
Docker ile çalıştırmak
‘15
Berat Doğan
beratdgan gmail.com
beratdgan
beratdogan
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 101
root@phpkonf:~# docker run hello-world
Unable 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 -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
f912ea95c1b0 hello-world "/hello" 8 minutes ago Exited (0) 8 minutes ago
Docker 1001
root@phpkonf:~# echo '<?php echo "Hello World!";' > index.php
root@phpkonf:~# docker ps -a
CONTAINER 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.php
Hello 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ı. :$
Demo
Laravel uygulamasını “Dockerize” edip,
çalıştırmak.
Sorular?

PHPKonf'15 PHP Uygulamalarını Docker ile Çalıştırmak