Upload
others
View
13
Download
0
Embed Size (px)
Citation preview
Docker and DevOpsWelcome everyone!
Agenda
1. About Us2. Motivation3. Docker4. DevOps5. Demo6. Questions
About Us
Chad Duffin Jeff Guzman Justin Bankes Shane MacBride
Cutting edge technology● Docker and DevOps are used heavily in the tech industry● Knowing these tools can help land you a career
Liatrio wants to give back to the community● Liatrio has a symbiotic relationship with CSU Chico● We want to become more involved with Butte
These tools and practices are nifty● We actively use these tools in class and at work● Want to share the knowledge to help prepare others for the industry
Motivation
Docker is...
...the leading software container platform.
Run software in a highly repeatable and predictable environment● Eliminates the notorious worked on my machine problem
Run software more efficiently● Run apps side by side with higher compute density● One machine instead of many
Develop, test and deploy software faster● Used in software delivery pipelines● Allows for much more rapid software development and delivery
Containers
Docker is software that you install on a computer, which can run containers.
A container is a logically isolated environment on your computer.● Dedicated to running a piece of software
○ Includes all of the dependencies for the software● Runs on top of the host kernel● Lightweight, fast
What is a container not?● A virtual machine
○ Fundamentally different architecture● A complete operating system
Docker containers and virtual machines are not mutually exclusive.
Images
Docker containers are created from Docker images.
What is an image?● A set of layers that defines everything necessary to run a desired piece of software● Immutable, can be thought of as a template for containers
The relationship between an image and a container is the same as the relationship between a class and an instance of that class.
● i.e. a container is the runtime equivalent of an image
Why layers?● An image needs a starting point; this is the base layer● A base layer can be any image● Reuse of layers can:
○ Save a significant amount of memory○ Allow for rapid building and rebuilding of images
Volumes
Docker volumes facilitate persistent storage for containers.
Wait. Containers don’t have persistent storage by default?● Nope● When a container is created from an image, it adds a write layer● This write layer is where all changes to files or directories go at runtime● When the container ends, the write layer is destroyed
Volumes allow us to kill two birds with one stone.● The changes that we make in a container can be saved
○ Very granular, can be a single file or entire directory● We can include files or entire directories that already exist on the host machine
Docker volumes can be mounted to multiple containers at the same time
Volumes cont.
There are four types of Docker volumes:● Bind mounted● Anonymous● Named● tmpfs
Bind Mounted● Allow you to mount files or directories on the host machine
Anonymous● When you want Docker to manage how and where the files are stored● Can be difficult to refer to and mount again as the names are hashes
Named● Very similar to an anonymous volume, but it can be given a name
tmpfs● Similar to anonymous / named volumes, but allows the data written to it to never
be written to permanent memory.
Dockerfiles
Dockerfiles are files that specify the steps required to build an image● Each step in the Dockerfile adds a layer to the image● A text file called Dockerfile with directives that resemble shell commands
Dockerfiles inherently provide some benefits:● The process of building an image is transparent, every step can be seen● The Dockerfile can be stored in source control
○ Keeps a history of changes that the resulting image underwent
It is important to optimize your Dockerfile● Minimize the number of layers● Do not install unnecessary dependencies● Many other ways to optimize
Optimizing Dockerfiles will:● Result in smaller images● Fewer security risks
DevOps is...
...a cultural and professional movement, focused on how we build and operate high velocity organizations, born from the experiences of its practitioners.
Culture● Inclusion● Collaboration● Fail fast, fail often
Process● How we reach our goals● Coupled tightly with our culture and tools● Improve the process iteratively
Tools● Enable work to be performed in a structured, repeatable and consistent manner● Enforces delivery pipelines through which work can be automated and measured
Why is DevOps necessary?
Traditional software development was done using the waterfall method● Not flexible to change● Incremental and sequential● Entire product and all dependencies mapped out before development begins
Why is this bad?● Cannot react to changes in market or customer needs● No value being gained until product completion● Deadlines are very difficult to meet, and are typically missed● Fosters animosity between teams● Slow feedback during development can result in obsolete features
Why is DevOps necessary? cont.
The Three Ways are principles that describe fundamental practices and beliefs of DevOps.
● Developed by seasoned professionals in the field● Frequently referenced and used
Systems Thinking● Learning how everything is interconnected, from concept to customer
Amplify Feedback Loops● Cutting the time between action and reaction, failure and success
Culture Of Continual Experimentation And Learning● Continual experimentation, taking risks and learning from failure● Repetition and practice is the prerequisite to mastery
The Three Ways
Software Delivery
A typical enterprise team’s software delivery is a nightmare.
● Giant, complex teams and applications
● Many dependencies across the board○ App A version 2.0.0 depends on App B version 1.5.0
● Lack of automation○ Deployments of artifacts, server configurations, etc. are manual
● Progress moves slowly○ Inadequate communication, lack of resources
● Time is more costly
Enter DevOps
DevOps practices and principles can be used to greatly improve the software delivery process.
To name a few…
● Immediate feedback on code changes, chat notifications
● Ability to generate environments at the push of a button
● Everything lives in source control
● Automated tests performed on code changes
● Dashboards for visibility
Docker and DevOps
Docker has multiple applications in the realm of DevOps● Consistent, predictable environments
○ Custom images that can replicate the desired production environment and even be deployed in production
● Build images○ Containers with all of the dependencies needed to build a project can
be spun up and torn down at will○ Allows the host machine to never install build dependencies for
the projects● Ease of deployment
○ An enterprise can develop an application and toss it into a Docker image
○ Docker containers can then be created from this image and run on a huge number of platforms
● Security○ Applications running in containers are entirely isolated from each
other
Docker Demo
Questions?
Resources
Intro To Docker - LinuxDocker Training Labs
Install DockerGetting StartedCreating Effective Images - Video By Docker
The Three Ways - Gene Kim
Red Panda Website