+ All Categories
Home > Documents > Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker...

Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker...

Date post: 20-May-2020
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
15
Simple Ways to Start Using Docker
Transcript
Page 1: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

Simple Ways to Start Using Docker

Page 2: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

Container Basics● isolation● packaging

Host Kernel & OS

Uncontained Programs

Page 3: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:
Page 4: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

Packaged Tool

Interaction mode:

1. one-off execution

Examples:

● mvn● nodejs● tcpdump● aws-cli● inspec

Problem: Many tools are complicated to install, configure, maintain, or conflict with other tools

Solution: Package a single tool for use as a direct replacement of a locally-installed binary

Usage: development, operations, training

tool

cfg work

Page 5: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

# the general form

alias api-cli='docker run --rm -it \

-e "API_KEY=${API_KEY}" \ # specific host env config

-v "$(pwd):/work" \ # share host work dir

org/api-cli:1.0.0' # specific version

# usage

$ api-cli list-resources

Page 6: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

aws-cliimage: qualimente/aws-cli:1.11.28

● created a Docker image with the AWS cli (python), entrypoint ‘aws’● created shell alias ‘aws’ that runs the docker image● provide credentials via AWS_* env vars

result: my AWS tooling now codified and available everywhere to anyone

Page 7: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

tcpdumpimage: corfr/tcpdump

● image with tcpdump installed and configured as entrypoint● nice default CMD options for recording all traffic to rotating files

show all traffic crossing the default docker bridge interface

docker run --rm -it --net=host corfr/tcpdump -i docker0

result: can inspect & debug network communications on containers and host

Page 8: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

Packaged Environment

Problem: Technical computing environments rely on many tools that are difficult to get working-together

Solution: Package a complete, tested environment to replace a collection of locally-installed binaries and configs

Usage: development, operations, training, production

Alternative to: Vagrant

Interaction mode:

1. one-off execution2. long-lived shell

Examples:

● software development ● infrastructure dev & mgmt● data analysis● security analysis● technical training

tool A

work

sh tool B

cfg

Page 9: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

Networking for Web Developers (Udacity)image: skuenzli/udacity-networking:2017-01-01

● Docker image includes tools required to complete course

result: trivial to distribute & [re-]create curated training environment

Page 10: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

infrastructure managementimage: https://github.com/qualimente/docker-infra-quickstart/tree/aws-single-region-swarm/Dockerfile

● Docker image includes packer, terraform, entrypoint ‘bash’● provide credentials via AWS_* env vars● can build and promote a set of tools through CI pipeline together

result: infra management env now codified and available everywhere to anyone

Page 11: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

Data ScienceBioContainers (https://biocontainers.pro/)

“an open source and community-driven framework which provides system-agnostic executable environments for bioinformatics software.”

● central registry ready-to-use containers https://biocontainers.pro/registry● specify how to create and deploy a BioContainers container/image● provide a complete infrastructure to create, share and request bioinformatics

software images

Page 12: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

Packaged Infra Service

Problem: Difficult to develop and deploy cross-cutting infra services; susceptible to resource usage problems

Solution: Deploy a complete, tested application to replace a collection of locally-installed binaries and configs

Usage: test, production

Interaction mode:

1. long-lived service

Examples:

● logging: logstash, fluentd● monitoring: collectd, datadog

service

cfg work

Page 13: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

logstashimage: logstash:2.3.4-1

● using ‘official’ logstash Docker image● logstash config provided via volume and cli● resource limits & restart policy!

result: can develop, test, and deploy log-shipping as a distinct, ısolated component

Page 14: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

Jenkins 2app: CDeasy

● uses jenkinsci/jenkins:2.35● define plugins in external-mounted plugins.txt● dsl-based job pipelines

result: Jenkins server and job configs now codified and portable

Page 15: Simple Ways to Start Using Docker - qualimente.com · show all traffic crossing the default docker bridge interface docker run --rm -it --net=host corfr/tcpdump -i docker0 result:

ResourcesWorkshop: Fundamentals of Docker

Feb 9, 2017

Discount: MEETUP01

https://www.picatic.com/qm-docker-engineers-2017-02?code=MEETUP01

Simple Ways to Start Using Dockerhttps://github.com/qualimente/start-using-docker-examples

Udacity Networking for Web Devshttps://www.udacity.com/course/networking-for-web-developers--ud256

@skuenzli

www.qualimente.com


Recommended