17
Docker, Containers, and the Future of Application Delivery Ivan Gaas

Docker, Containers, and the Future of Application Delivery Ivan Gaas

Embed Size (px)

DESCRIPTION

Ivan Gaas DevOps Engineer Chef base = %w{ apt build-essential git curl vim } apache= %w{ apache2 apache2::mod_rewrite apache2::mod_php5 apache2::mod_expires } php = %w{ php php::module_mysql php::module_memcache php::module_gd php::module_curl} mysql = %w{ mysql::server} drupal= %w{ drush memcached } [base, apache, php, mysql, drupal].each do |group| group.each {|recipe| include_recipe recipe} end pkgs = value_for_platform( [ 'centos', 'redhat', 'fedora' ] => 'default' => %w{ pcre-devel php-mcrypt } }, [ 'debian', 'ubuntu' ] => { 'default' => %w{ libpcre3-dev php5-mcrypt } }, 'default' => %w{ libpcre3-dev php5-mcrypt} ) pkgs.each {|pkg| package ( pkg ) { action :install } } php_pear ('uploadprogress') { action :install } template "#{node['php']['ext_conf_dir']}/deploy-drupal.ini" do source "deploy-drupal.ini.erb" mode 0644 owner "root" group "root" notifies :reload, "service[apache2]" end class drupal_sandbox ( $virtual_document_root = '/srv/www/vhost/%0', $use_varnish = false, $php_memory_limit = $drupal_sandbox::params::php_memory_limit, $apache_addr = $drupal_sandbox::params::apache_addr, $apache_port = $drupal_sandbox::params::apache_port, $memcache_mem = $drupal_sandbox::params::memcache_mem, $apache_mpm_wk_max_clients = $drupal_sandbox::params::apache_mpm_wk_max_clients, $fpm_max_children = $drupal_sandbox::params::fpm_max_children, $fpm_start_servers = $drupal_sandbox::params::fpm_start_servers, $fpm_min_spare_servers = $drupal_sandbox::params::fpm_min_spare_servers, $fpm_max_spare_servers = $drupal_sandbox::params::fpm_max_spare_servers, $innodb_buffer_pool_size = $drupal_sandbox::params::innodb_buffer_pool_size, $innodb_log_file_size = $drupal_sandbox::params::innodb_log_file_size ) inherits drupal_sandbox::params Puppet - group_by: key={{ ansible_os_family }} - name: make sure the ssh user is part of users user: name={{ ansible_ssh_user }} groups=users,{{ www_user }} append=yes when: ansible_ssh_user != 'root' - name: make sure the vhosts directory exists (ignore chgrp errors on vagrant) file: path=/var/www/vhosts/{{ item.key }} state=directory mode=2775 owner={{ ansible_ssh_user }} group=users with_dict: sites ignore_errors: true - name: Clone the code from repository git: repo={{ item.value.git }} dest=/var/www/vhosts/{{ item.key }}/drupal version={{ item.value.version }} accept_hostkey=yes with_dict: sites sudo: no - name: Create files folder (ignore chgrp errors on vagrant) file: path=/var/www/vhosts/{{ item.key }}/drupal/sites/default/files state=directory mode=2775 owner={{ ansible_ssh_user }} group={{ www_user }} recurse=yes with_dict: sites ignore_errors: true - name: Create cache folder (boost) (ignore chgrp errors on vagrant) Ansible Skipped over lines…

Citation preview

Page 1: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Docker, Containers, and the Future

of Application DeliveryIvan Gaas

Page 2: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Problems:

• How to configure destination server the same way of my one?

• How to do it repeatable and automatically?

• How to delivery my project to this server?

• How to be sure my project will work always with right environment?

Page 3: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Chefbase = %w{ apt build-essential git curl vim }

apache= %w{ apache2 apache2::mod_rewrite apache2::mod_php5 apache2::mod_expires }php = %w{ php php::module_mysql php::module_memcache php::module_gd php::module_curl}mysql = %w{ mysql::server}drupal= %w{ drush memcached }[base, apache, php, mysql, drupal].each do |group| group.each {|recipe| include_recipe recipe}endpkgs = value_for_platform( [ 'centos', 'redhat', 'fedora' ] => 'default' => %w{ pcre-devel php-mcrypt } }, [ 'debian', 'ubuntu' ] => { 'default' => %w{ libpcre3-dev php5-mcrypt } }, 'default' => %w{ libpcre3-dev php5-mcrypt})pkgs.each {|pkg| package ( pkg ) { action :install } }php_pear ('uploadprogress') { action :install }template "#{node['php']['ext_conf_dir']}/deploy-drupal.ini" do source "deploy-drupal.ini.erb" mode 0644 owner "root" group "root" notifies :reload, "service[apache2]"end

class drupal_sandbox ( $virtual_document_root = '/srv/www/vhost/%0', $use_varnish = false, $php_memory_limit = $drupal_sandbox::params::php_memory_limit, $apache_addr = $drupal_sandbox::params::apache_addr, $apache_port = $drupal_sandbox::params::apache_port, $memcache_mem = $drupal_sandbox::params::memcache_mem, $apache_mpm_wk_max_clients = $drupal_sandbox::params::apache_mpm_wk_max_clients, $fpm_max_children = $drupal_sandbox::params::fpm_max_children, $fpm_start_servers = $drupal_sandbox::params::fpm_start_servers, $fpm_min_spare_servers = $drupal_sandbox::params::fpm_min_spare_servers, $fpm_max_spare_servers = $drupal_sandbox::params::fpm_max_spare_servers, $innodb_buffer_pool_size = $drupal_sandbox::params::innodb_buffer_pool_size, $innodb_log_file_size = $drupal_sandbox::params::innodb_log_file_size) inherits drupal_sandbox::params

Puppet - group_by: key={{ ansible_os_family }}

- name: make sure the ssh user is part of users user: name={{ ansible_ssh_user }} groups=users,{{ www_user }} append=yes when: ansible_ssh_user != 'root'- name: make sure the vhosts directory exists (ignore chgrp errors on vagrant) file: path=/var/www/vhosts/{{ item.key }} state=directory mode=2775 owner={{ ansible_ssh_user }} group=users with_dict: sites ignore_errors: true- name: Clone the code from repository git: repo={{ item.value.git }} dest=/var/www/vhosts/{{ item.key }}/drupal version={{ item.value.version }} accept_hostkey=yes with_dict: sites sudo: no- name: Create files folder (ignore chgrp errors on vagrant) file: path=/var/www/vhosts/{{ item.key }}/drupal/sites/default/files state=directory mode=2775 owner={{ ansible_ssh_user }} group={{ www_user }} recurse=yes with_dict: sites ignore_errors: true- name: Create cache folder (boost) (ignore chgrp errors on vagrant)

Ansible

Skipped over 100500 lines…

Page 4: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

WTF???

Chef Puppet

Ansib

le

SaltStack

Page 5: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Why and what is Docker?

Page 6: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Environment compatibility nightmare

Page 7: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Cargo transport pre 1960

Page 8: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Delivery matrix

Page 9: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Solution: shipping containers

Page 10: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Containers are standard

Page 11: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Docker containers

Page 12: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Delivery matrix

Page 13: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Docker is not only containers but packaging layers

Me: Anyone:

Base layer

Base layer

My layer Anyone’s layer

Common layerCommon layer

Page 14: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Docker layers

Page 15: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Fast and easy startJust learn:

• docker pull• docker run• docker exec• docker commit• docker push

As easy as basic GIT!

Page 16: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Enjoy!

Page 17: Docker, Containers, and the Future of Application Delivery Ivan Gaas

Ivan GaasDevOps Engineer

Ivan GaasDevOps Engineer

https://www.linkedin.com/in/ivangaas

Золотой спонсор:

Thank you!

При поддержке:

Серебряный спонсор: