Redgate
@rob_rich

Database DevOps
with Containers

by Rob Richardson

@rob_rich

https://robrich.org/


Rob Richardson

Developer

Microsoft MVP and Friend of Red Gate



@rob_rich

Goals of DevOps

Automate all the things

Because computers are cheaper than people

DevOps Pipeline

DevOps Pipeline for Apps


suggestion

check out

code

build

test

deploy

qa

prod

feedback
Icons: Icons8 and Font Awesome

DevOps Pipeline for Apps


suggestion

check out

code

build

test

deploy

qa

prod

feedback
Icons: Icons8 and Font Awesome

DevOps Pipeline for Apps

Where is the master copy?


suggestion

check out

code

build

test

deploy

qa

prod

feedback
Icons: Icons8 and Font Awesome

DevOps Pipeline for Apps DBs?

Where is the master copy?


suggestion

check out

code

build

test

deploy

qa

prod

feedback
Icons: Icons8 and Font Awesome

DevOps Pipeline for Databases


developer

dev/test

pre-prod

prod

Icons: Icons8 and Font Awesome

DevOps Pipeline for Databases


developer

dev/test

pre-prod

prod

Icons: Icons8 and Font Awesome

DevOps Pipeline for Databases


developer

dev/test

pre-prod

prod

Icons: Icons8 and Font Awesome

DevOps Pipeline for Databases


developer

dev/test

pre-prod

prod

Icons: Icons8 and Font Awesome

DevOps Pipeline for Databases


developer

dev/test

pre-prod

prod

Icons: Icons8 and Font Awesome

DevOps Pipeline for Databases

Tweaked for each environment:

  • anonymize
  • sanitize
  • shrink
  • migrate to latest version
  • validate

DevOps Goals

Automate all the things

How can we automate this?

with Docker containers

Docker

Docker

What are containers?

How do I build them in an automated way?

How is this better than VMs / Puppet / Chef?

"Docker: VM++"

What is Docker?

Docker is an ecosystem around Container Virtualization

What are Containers?

Light-weight kernel virtualization

What is Docker?

A suite of command-line tools for
creating, running, and sharing containers

Containers vs VMs

vm vs container

Source: http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/

Containers

virtualize and share the host kernel

must match host kernel:

  • Linux containers run on a Linux host
  • Windows Server containers run on a Windows Server host

Host Docker in a VM

docker nested in a vm

Docker Ecosystem

docker ecosystem

Download: https://robrich.org/slides/welcome-to-docker/docker-ecosystem.pdf

Devs build Images

FROM microsoft/dotnet:2.1-aspnetcore-runtime

WORKDIR /app

COPY Site.csproj .
RUN dotnet restore

COPY . .

RUN dotnet build -c Release
RUN dotnet publish -c Release -o dist

WORKDIR /app/dist

ENV ASPNETCORE_URLS http://+:5000
EXPOSE 5000
CMD ["dotnet", "Site.dll"]

SQL Server

DEMO: SQL Server DevOps