Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using Docker for QA and Continuous Integration

Using Docker for QA and Continuous Integration

This presentation explains the basics on how to implement Docker for QA tests and Continuous Integration deploys.

Yamil Urbina

May 15, 2015
Tweet

More Decks by Yamil Urbina

Other Decks in Programming

Transcript

  1. What is Docker? • Is a set of tools to

    run multiple Linux systems on a single Linux host • It beats VMWare, VirtualBox, KVM or any existing virtualisation tool on speed and resource usage
  2. Using it for real • Create a base image with

    Dockerfile • Boot the image and automate software deployments • Use the image for testing and verification • Destroy and repeat
  3. FROM centos:6.5 # Install requirements RUN yum --enablerepo=remi install httpd

    -y # Load Volume VOLUME /files # Expose ports EXPOSE 80 # Copying the install script COPY install-app.sh /install-app.sh CMD ["/install-app.sh"]
  4. $ docker build -t company/app . Uploading context 10.24 kB

    Step 1 : FROM centos:6.5 ---> cbba202fe96b Step 2 : yum --enablerepo=remi install httpd -y ---> Using cache ---> 1a5ffc17324d … … … Successfully built 1a5ffc17324d
  5. $ docker run -d -P company/app -d: Daemonize and run

    in the background -P: Map all exposed ports
  6. FROM centos:6.5 # Install requirements RUN yum --enablerepo=remi install httpd

    -y # Load Volume VOLUME /files # Expose ports EXPOSE 80 # Copying the install script COPY install-app.sh /install-app.sh CMD ["/install-app.sh"]
  7. #!/bin/bash set -e # Copy all files to /tmp cp

    /files/* /tmp/ && cd /tmp # Installing Frontend if [ -e ./frontend.tar.gz ];then tar xzf frontend.tar.gz ln -s /tmp/frontend /var/www/html echo "SUCCESS: Frontend installed." else echo "ERROR: frontend.tar.gz not found.” exit 1 fi service httpd start
  8. 1. Starts the OS image 2. Loads /files/ volume 3.

    Executes install-app.sh 4. Exposes port 80 5. Starts HTTPD 6. Ready: http://ip:port
  9. +

  10. • Build your software with Jenkins • Deploy to a

    Docker container • Multiple versions to test? Launch more containers and save money on servers • Done? Destroy the container