container-virtualisierung ddoocckkeerr · docker run --name "hello-world" ubuntu echo...

19
eine Vorstellung der Container-Virtualisierung DOCKER DOCKER und ihr Einsatz in der Entwicklung von VuFind(2) Ulf Seltmann <[email protected]> Webmaster Projekt �nc Universitätsbibliothek Leipzig Bildquelle: http://www.geeek.org/boot2docker-utilisez-docker-sur-windows-et-mac-en-deux-clics-026.html

Upload: hoanghanh

Post on 20-Jan-2019

227 views

Category:

Documents


0 download

TRANSCRIPT

eine Vorstellung derContainer-Virtualisierung

DOCKERDOCKERund ihr Einsatz in derEntwicklung von VuFind(2)Ulf Seltmann <[email protected]>WebmasterProjekt �ncUniversitätsbibliothek Leipzig

Bildquelle: http://www.geeek.org/boot2docker-utilisez-docker-sur-windows-et-mac-en-deux-clics-026.html

Bildquelle: http://www.geeek.org/boot2docker-utilisez-docker-sur-windows-et-mac-en-deux-clics-026.html

ÜBER MICHÜBER MICH2000 bis 2007 Administrator im Web-/Linux-Umfeld2007 Programmierer für PHP im Bereich e-Commerceseit April 2013 Programmierer in der UB Leipzig,erst im Projekt �nc, jetzt als Webmaster

WARUM EINE EINHEITLICHEWARUM EINE EINHEITLICHETESTUMGEBUNGTESTUMGEBUNG

einfache InstallationVermeidung von abweichenden ErgebnissenEntwicklungswerkzeuge out-of-the-Box nutzbareinfaches Umschalten der Testumgebung

WAS IST DOCKERWAS IST DOCKERContainervirtualisierung für linuxoide BetriebssystemeImages beinhalten die notwendigen Abhängigkeiten einesauszuführenden Programmesein Container ist der isolierte Bereich, in dem dasProgramm ausgeführt wirdResourcen werden per kernel namespaces, cgroups, chrootund selinux vom Host-System isoliert

Bildquelle: http://xebia.github.io/docker-introduction/slides/#/

DOCKER-IMAGESDOCKER-IMAGESleitet ab von Basis-ImageDockerfile beschreibt die zusätzlicheInstallation/Kon�gurationImage-Änderungen werden revisioniertImages werden ver-/ge-teilt über ö�entliches oder privatesRepository

DOCKER-CONTAINERDOCKER-CONTAINERbasieren auf einem Imagestartet mit dem Start eines Programms und beendet mitdessen Beendigungkönnen Dateien und Order des Hostsystems oder andererContainer einbindenkönnen Ports an das Hostsystem oder andere Containerforwarden

HELLO WORLD!HELLO WORLD!docker run --name "hello-world" ubuntu echo "Hello World!"

run-Kommando legt die Container-Kon�guration fest

Unable to find image 'ubuntu:latest' locallyPulling repository ubuntu91e54dfb1179: Download completed3a1f33e8a5a: Download completec22013c84729: Download completed74508fb6632: Download completeStatus: Downloaded newer image for ubuntu:latestHello World!#$

HELLO WORLD! (AGAIN)HELLO WORLD! (AGAIN)docker start -i -a hello-world

erneute Container-Starts führen den Container mit derKon�guration aus, die mit dem run-Kommando festgelegtwurde

Hello World!#$

Bildquelle: http://www.opengeekservice.cl/sitio/es/bibliotecas/vu�nd.html

VUFIND2 MIT DOCKERVUFIND2 MIT DOCKER

VuFind-Sourcen klonengit clone https://github.com/vufind-org/vufind.git

Klone nach 'vufind'...remote: Counting objects: 106741, done.remote: Compressing objects: 100% (20/20), done.remote: Total 106741 (delta 6), reused 0 (delta 0), pack-reused 106720Empfange Objekte: 100% (106741/106741), 388.15 MiB | 3.83 MiB/s, Fertig.Löse Unterschiede auf: 100% (69166/69166), Fertig.Prüfe Konnektivität... Fertig.

VuFind-Container startensudo docker run -t -i \ -v $(pwd)/vufind:/usr/local/vufind2 \ -p 80:80 -p 443:443 -p 8080:8080 -p 3306:3306 \ useltmann/vufind2

Unable to find image 'useltmann/vufind2:latest' locallyPulling repository useltmann/vufind2dbce69cc9264: Download complete4c8cbfd2973e: Download complete...138278fd23d3: Download completeStatus: Downloaded newer image for useltmann/vufind2:latestSetting up owner/group of dev...Setting up runtime environment...Setting up 10-mysqld......

Container aufrufen

http://localhost/vufind/

Bildquelle: https://commons.wikimedia.org/wiki/User:Eurobas

DIE IMAGE-TOOLSDIE IMAGE-TOOLS

PHP-Einstellungen mit PHPInfo

http://localhost/phpinfo/

Debugging mit XDebug

Pro�ling mit XDebug und webgrind

http://localhost/webgrind/

OPCode- und Variable Cache mit XCache

http://localhost/xcache/

PHPUnitsudo docker run --rm -t -i -v $(pwd)/vufind:/usr/local/vufind2 \ useltmann/vufind2 phpunit

PHPUnit 4.8.9 by Sebastian Bergmann and contributors.....Time: 9.07 seconds, Memory: 95.00Mb

OK, but incomplete, skipped, or risky tests!Tests: 801, Assertions: 2137, Skipped: 36.

Bildquelle: http://openitagency.eu/open-source/

BUILD-SOURCEN AUF GITHUBBUILD-SOURCEN AUF GITHUB

https://github.com/finc/docker-vufind2/

IMAGE AUF DOCKER HUBIMAGE AUF DOCKER HUB

https://hub.docker.com/r/useltmann/vufind2/

VIELEN DANKVIELEN DANKUlf Seltmann <[email protected]>WebmasterProjekt �ncUniversitätsbibliothek Leipzig

https://hub.docker.com/r/useltmann/vu�nd2/https://github.com/�nc/docker-vu�nd2/https://�nc.info/de/https://ub.uni-leipzig.de/