Slide 1

Slide 1 text

GARETH RUSHGROVE Product Manager, Docker Cloud-Native Developer Workflows for Docker Applications

Slide 2

Slide 2 text

- The building blocks for Docker applications - What we mean by developer workflow - Reducing developer friction - Lots of demos What we’ll cover

Slide 3

Slide 3 text

The Docker fundamentals Building Blocks

Slide 4

Slide 4 text

Docker Desktop - Docker and Kubernetes on your local machine - Easy to install and easy to manage

Slide 5

Slide 5 text

- Describe the steps to build a Docker image - More than 1.1m Dockerfiles public on GitHub Dockerfile # We name the `base` stage so we can reference it in multiple later # stages but only need to update it in one place if we change it FROM python:3-alpine AS base WORKDIR /app RUN pip install pipenv==2018.10.13 COPY Pipfile /app/ COPY Pipfile.lock /app/ RUN pipenv install --system --deploy # The `app` stage is used as the base for images that don't # need the development dependencies FROM base AS app COPY src /app # The `test-base` stage is used as the base for images that require # the development dependencies. FROM base AS test-base

Slide 6

Slide 6 text

Compose and Kubernetes config - Describe the components of your multi-service application in code version: '3.7' services: sensu-backend: image: sensu/sensu:latest command: sensu-backend start hostname: sensu-backend ports: - 3000:3000 - 8080:8080 sensu-agent: image: sensu/sensu:latest command: sensu-agent start --backend-url ws://sensu-backend:8081 depends_on: - sensu-backend deploy: replicas: 4

Slide 7

Slide 7 text

Your source code - The most important part. Your application. export default () => (
Hello world

scoped!

{` p { color: blue; } div { background: red; } @media (max-width: 600px) { div { background: blue; } } `}

Slide 8

Slide 8 text

How we use our tools together Workflow

Slide 9

Slide 9 text

workflow Noun the sequence of industrial, administrative, or other processes through which a piece of work passes from initiation to completion.

Slide 10

Slide 10 text

The hard way - Just use the low-level tools - Workflow is by memory, or maybe documentation if you’re lucky $ kubectl run --image hello-dockercon:1 hello --port=8080 deployment.apps "hello" created $ kubectl get deployment hello -o json { "apiVersion": "extensions/v1beta1", "kind": "Deployment", "metadata": { "annotations": { "deployment.kubernetes.io/revision": "1" }, "creationTimestamp": "2018-11-26T12:42:53Z", "generation": 1, "labels": { "run": "hello" }, "name": "hello", "namespace": "default",

Slide 11

Slide 11 text

Pick and mix - Wrap everything in a Makefile (or similar) - Introduce other tools $ make do-everything

Slide 12

Slide 12 text

From within an IDE - Integrated functionality in your editor - Customisation via plugins $ cat spec.txt Cloud Native Application Bundle Core 1.0.0 (CNAB1) Working Draft, Nov. 2018 Cloud Native Application Bundles (CNAB) are a standard packaging format for multi-component distributed applications. It allows packages to target different runtimes and architectures. It empowers application distributors to package applications for deployment on a wide variety of cloud platforms, cloud providers, and cloud services. It also provides the capabilities necessary for delivering multi-container applications in disconnected environments. CNAB is not a platform-specific tool. While it uses

Slide 13

Slide 13 text

The same fundamentals - Writing code - Testing code - Building artefacts - Running code

Slide 14

Slide 14 text

Working with others Team Workflow

Slide 15

Slide 15 text

Source control - Share code and changes with other people

Slide 16

Slide 16 text

Continuous integration - Ensure you always have a working, integrated version of your software

Slide 17

Slide 17 text

Docker registry - Store your artefacts centrally - Avoid the need to constantly rebuild and retest

Slide 18

Slide 18 text

The same fundamentals - Writing code - Testing code - Building artefacts - Running code

Slide 19

Slide 19 text

Time for a few demos Reducing Developer Friction

Slide 20

Slide 20 text

friction Noun the resistance that one surface or object encounters when moving over another.

Slide 21

Slide 21 text

friction Noun conflict or animosity caused by a clash of wills, temperaments, or opinions.

Slide 22

Slide 22 text

developer friction Made up concept the resistance that a developer encounters when trying to do their job

Slide 23

Slide 23 text

friction Noun ...the energy lost to friction is turned into sound and heat.

Slide 24

Slide 24 text

So how can we reduce the friction when it comes to developer workflow?

Slide 25

Slide 25 text

Demo time

Slide 26

Slide 26 text

If all you remember is... Conclusions

Slide 27

Slide 27 text

Build - Multi-stage builds can reduce the need for scripts - New tools like docker assemble reduce the need for configuration at all $ docker fab build . [+] Building 8.2s (13/16) => local://project (docker-hlb.yaml) => => transferring project: 2B => local://project (*.[fc]sproj) => => transferring project: 2B => local://project (pom.xml) => => transferring project: 29B => resolve image config for docker.io/library/maven:3-jdk-10-slim => resolve image config for docker.io/docker/dockerfile-copy:v0.1.8 => resolve image config for docker.io/library/openjdk:10-jre-slim => runtime image => => resolve docker.io/library/openjdk:10-jre-slim@sha25 => => sha256:7e9a9557c5738bcf45787bbc6bf5fff60f06562c2ddb

Slide 28

Slide 28 text

Inner-loop development - Change code or configuration, automatically rebuild images and run application locally $ cat skaffold.yaml apiVersion: skaffold/v1alpha5 kind: Config build: tagPolicy: sha256: {} artifacts: - image: garethr/skaffold-example local: useBuildkit: true deploy: kubectl: manifests: - stack.yaml

Slide 29

Slide 29 text

Testing - Fast feedback - Share tests between applications to help enforce organisational policy $ cat .github/main.workflow action "test" { uses = "actions/docker/cli@master" args = "build --target test ." } action "security" { uses = "actions/docker/cli@master" secrets = ["MICROSCANNER"] args = "build --target security --build-arg MICROSCANNER } action "lint" { uses = "actions/docker/cli@master" args = "run -i hadolint/hadolint hadolint -

Slide 30

Slide 30 text

Packaging multi-service applications - Share applications with others easily with docker app - Reduce operator friction by defining clear interfaces $ docker-app install garethr/myapp Waiting for the stack to be stable and running... service1: Ready service2: Ready mysql: Ready Stack hello is stable and running

Slide 31

Slide 31 text

- Always be looking for ways to reduce developer friction - Improvements might be incremental, or they might be revolutionary - Composable tools are one honking great idea, let's do more of those! In summary

Slide 32

Slide 32 text

Take A Breakout Survey Access your session and/or workshop surveys for the conference at any time by tapping the Sessions link on the navigation menu or block on the home screen. Find the session/workshop you attended and tap on it to view the session details. On this page, you will find a link to the survey.

Slide 33

Slide 33 text

https://dockr.ly/Forrester Get the Forrester Report on Container Platforms For more information visit:

Slide 34

Slide 34 text

Come Join Us In San Francisco April 29-May 2 2019

Slide 35

Slide 35 text

Thanks And any questions?