Skip to content

Latest commit

 

History

History
217 lines (145 loc) · 7.95 KB

README.md

File metadata and controls

217 lines (145 loc) · 7.95 KB

Docker Learning

Docker Learning Course

Duration: Two weeks, three days per each week, 1 hour per day

Week 1

Learning Docker

Day 1

Inception with Docker basics

  • Container execution and deatached execution
  • Images
    • Layers
    • Tags
    • Docker public registry
  • Builds
    • Dockerfile
    • Build, commit, push
  • CMD and ENTRYPOINT differences
  • Pets vs Cattle
  • Docker Development Flow

Reference repositories:

Day 2

Docker Elements

  • Containers
  • Images
  • Networks
  • Volumes

Refertence repositories:

Day 3

Docker Compose

  • Docker compose file
  • Parameters with .env
  • Platform definition and usage
  • Real examples with live projects

Reference repositories:

External resources:

Week 2

Using Docker

Day 4

Docker compose in real projects

Reference repositories: none that we can share :)

Day 5

Choose one of the following options

Docker in depth

  • Docker in Docker
    • Ubuntu DIND
    • Official Docker in Docker
  • Quality pieces with Docker
    • Jenkins in Docker
    • Sonar with real live project
    • Zalenium: Selenium Grid with steroids in Docker
  • Windows in Docker

Reference repositories:

Dockerize an application

Put Docker on the Spring Boot Angular4 Heroes sample application.

Stages:

  1. Follow the instructions of the project and install on your workstation or laptop all the stuff to execute the application.
  2. Build a docker-compose platform in two services: database and application.
  3. Compare with the Kairops Fork of the project and the solution proposed here. Don't cheat and look only when you are finished the sedond stage.

Tips:

  • Use MySQL 5.x or MariaDB 5.x versions for the database service.
  • Use debian based image for the application service.
  • Add --disable-host-check and --host 0.0.0.0 parameters for the ng start command.

Top goal:

  • Try to split the application in two Docker services: backend and frontend.

Day 6

Choose one of the following options

BDD with Docker

Use the project Duing to dessign and execute a BDD test

Demonstrate how we can use Docker to run a complete linux Desktop environment with all the tools needed to materialize complex tasks.

Reference repositories:

Kubernetes Inception

Take a look at Kubernetes using local minikube and this Docker Compose Example project.

Thanks to Álvaro for this work.

Further reading

Stuff Intallation

You can download the whole Docker images and clone the whole referenced repositories with a script within the project.

Execute the command:

devcontrol/actions/install-stuff.sh exec

...or use devcontrol install-stuff if you have Devcontrol installed on your system) and wait for the script to finish.

BDD examples

Find in the bdd-examples directory of the repository some examples of BDD test created as part of the day 6 session.

To execute the tests:

  1. Start a duing container with the repository shared as volume within it.

    docker run --name duing \
              -p 3389:3389 \
              --shm-size 1g \
              -dit --restart unless-stopped \
              -v $(pwd):/opt/docker-learning \
              ayudadigital/duing
  2. Copy the /opt/docker-learning/bdd-examples/test/ directory in /opt/duingdemo/ci-scripts/test/. This will add the examples to the features directory.

    $ docker exec -u ubuntu duing cp -rv /opt/docker-learning/bdd-examples/test/ /opt/duingdemo/ci-scripts/
    '/opt/docker-learning/bdd-examples/test/cucumber/features/step_definitions/bddfire_steps.rb' -> '/opt/duingdemo/ci-scripts/test/cucumber/features/step_definitions/bddfire_steps.rb'
    '/opt/docker-learning/bdd-examples/test/cucumber/features/github_search.feature' -> '/opt/duingdemo/ci-scripts/test/cucumber/features/github_search.feature'
  3. Follow the instructions of the Duing project.

    Take care that github can't be tested with PhantomJS, so the rake poltergeist command will end with an error.

    ubuntu@7a0e1ec3060f:/opt/duingdemo/ci-scripts/test/cucumber$ rake poltergeist
    /usr/bin/ruby2.5 -S bundle exec cucumber features -p poltergeist --format pretty --profile html -t ~@api
    {"baseurl"=>"https://www.google.es", "take_screenshots"=>false, "screenshot_delay"=>1, "browser_width"=>1024}
    Using the poltergeist and html profiles...
    Feature: Google Search to explore BDDfire
    
      Scenario: View home page                      # features/bddfire.feature:4
        Given I am on "http://www.google.com?hl=en" # bddfire-3.0.2/lib/bddfire/web/web_steps.rb:2
        When I fill in "q" with the text "bddfire"  # bddfire-3.0.2/lib/bddfire/web/web_steps.rb:6
        Then I should see "Sign in"                 # bddfire-3.0.2/lib/bddfire/web/web_steps.rb:10
    
    Feature: Github search for a library
    
      Scenario: Search library within github                # features/github_search.feature:3
        Given I am on "https://www.github.com"              # bddfire-3.0.2/lib/bddfire/web/web_steps.rb:2
          Request to 'https://www.github.com' failed to reach server, check DNS and/or server status (Capybara::Poltergeist::StatusFailError)
          features/github_search.feature:4:in `Given I am on "https://www.github.com"'
        When I fill in "Search GitHub" with the text "vavr" # bddfire-3.0.2/lib/bddfire/web/web_steps.rb:6
        And I press intro key with my little finger         # features/step_definitions/bddfire_steps.rb:3
    
    Failing Scenarios:
    cucumber -p poltergeist -p html features/github_search.feature:3 # Scenario: Search library within github
    
    2 scenarios (1 failed, 1 passed)
    6 steps (1 failed, 2 skipped, 3 passed)
    0m1.410s