SlideShare a Scribd company logo
1 of 70
Download to read offline
Continuous Integration with
Docker and Bamboo
STEVE SMITH • DEVOPS ADVOCATE • ATLASSIAN • @TARKASTEVE
https://bitbucket.org/ssmith/atlascamp2015-docker-ci
© http://www.amigosdosbichos.org/
Warning:
Bad analogies coming up…
VMs vs Containers
Huffington Post
Virtual Machine
Virtual HW
BIOS/EFI
Guest FS / Kernel
Applications
Physical Hardware
Host FS / Kernel
VM Hypervisor
BIOS/EFI
Virtual HW
BIOS/EFI
Guest FS / Kernel
Applications
Containers / Docker
Physical Hardware
Host FS / Kernel
Docker
Engine
BIOS/EFI
Guest FS
Application
Guest FS
Application Virtual HW
BIOS/EFI
Guest FS / Kernel
Applications
Physical Hardware
Host FS / Kernel
VM Hypervisor
BIOS/EFI
Virtual HW
BIOS/EFI
Guest FS / Kernel
Applications
Using features of the Linux kernel
Docker
libcontainer
systemd
nspawn
libvirt
cgroups
CPU accounting
Namespaces
Posix capabilities
btrfs
OverlayFS
LXC
Unix: chroot
Containers take this further…
Network
Abstraction
Process
Isolation
Filesystem
Isolation
Resource
Limits
Docker takes this to the next level…
Build Tools Packaging
Lifecycle Communication Dev (boot2docker)
Sharing
boot2docker
Virtual Hardware
Host FS / Kernel
BIOS/EFI
Guest FS
Application
Guest FS
Application
Quick Demo
Peter Kastner
Docker Concepts
Carlsberg
Docker containers are like OO classes…
Inheritance
Sourcefile
(Dockerfile) Compile
Dep. Injection Declarative Deps
FROM ubuntu:trusty
RUN apt-get update && 
apt-get install -y nginx && 
apt-get clean
EXPOSE 80
EXPOSE 443
CMD nginx -g daemon off;
Single inheritance
Add member
Override parent behaviour
Exposed linking points
Dockerfile ~= Sourcefile
Inheritance resolved at runtime
Ubuntu
Add nginx
Add run command
(sorta like JVM class assembly)
Union Filesystem
- AUFS
- BTRFS
- Devicemapper
- OverlayFS
‘run’ instantiates a new container
Ubuntu
Add nginx
Add run command
Writable
Immutable
(kinda like ‘new’)
Runtime layer
[ssmith] $ docker build -q --tag=mynginx docker/mynginx/
Sending build context to Docker daemon 12.72 MB
Sending build context to Docker daemon
Step 0 : FROM ubuntu:trusty
---> 8eaa4ff06b53
Step 1 : RUN apt-get update && apt-get install -y nginx && apt-get clea
---> Running in f05a4a034fe3
---> 1e84ac75dd9a
Removing intermediate container f05a4a034fe3
Step 2 : EXPOSE 80
---> Running in 77602b8eb9ec
---> 4076f56233ff
Removing intermediate container 77602b8eb9ec
Step 3 : EXPOSE 443
---> Running in b627b8c1d328
---> f5a3ff140964
Removing intermediate container b627b8c1d328
Step 4 : CMD nginx -g daemon off;
---> Running in 132573fe4fc9
---> c1df0408cf70
‘build’ compiles to binary
Inspecting the stack
[ssmith] $ docker history mynginx
IMAGE CREATED CREATED BY
606f0f611cb2 6 days ago /bin/sh -c #(nop) CMD [nginx -g daemon off;]
27d0fad8620d 6 days ago /bin/sh -c #(nop) EXPOSE map[443/tcp:{}]
dc26b50e9806 6 days ago /bin/sh -c #(nop) EXPOSE map[80/tcp:{}]
7a04b014a0a7 6 days ago /bin/sh -c apt-get update && apt-get install
b39b81afc8ca 9 days ago /bin/sh -c #(nop) CMD [/bin/bash]
615c102e2290 9 days ago /bin/sh -c sed -i 's/^#s*(deb.*universe)$/
837339b91538 9 days ago /bin/sh -c echo '#!/bin/sh' > /usr/sbin/polic
53f858aaaf03 9 days ago /bin/sh -c #(nop) ADD file:ca5b63647c6b7a419e
511136ea3c5a 19 months ago
Linked Containers
(dependency injection; sort-of…)
Docker host
postgresql client
--link postgresql:pg
can refer to
hostname pg
in commands
Volumes
Docker host
/var/volume1
DATA
/var/volume2
/var/volume1
client1
/var/volume2
--volumes-from DATA
(haven’t got a class analogy for this one)
Discussion
Testing with Docker
The example project
?
https://bitbucket.org/ssmith/atlascamp2015-docker-ci
The example project
Transfer
Trigger / Async
Data
Data
(See http://bit.do/postgres-es for details)
How to test…
Vagrant?
Dependencies
everywhere?
Docker?
Docker testing
Reuse images Startup speed Idempotent tests
Dev / Test match Deploy to Docker
Creating our images
Elasticsearch Dockerfile
FROM java:openjdk-7-jre
ENV ES_VER 1.3.4
ENV ES_URL https://download.elasticsearch.org/elasticsearch/elasticsearch/
elasticsearch-${ES_VER}.tar.gz
WORKDIR /opt/
RUN adduser --system elasticsearch
RUN curl ${ES_URL} -o elasticsearch.tgz && 
tar xzf elasticsearch.tgz && 
ln -s elasticsearch-${ES_VER} elasticsearch && 
mkdir /opt/elasticsearch/data/ && chown elasticsearch /opt/elasticsearch/data/ && 
mkdir /opt/elasticsearch/logs/ && chown elasticsearch /opt/elasticsearch/logs/ && 
rm elasticsearch.tgz
EXPOSE 9200
EXPOSE 9300
USER elasticsearch
CMD /opt/elasticsearch/bin/elasticsearch -f
Elasticsearch build
[ssmith] docker build -q --tag=elasticsearch docker/elasticsearch/
Sending build context to Docker daemon 2.56 kB
Sending build context to Docker daemon
Step 0 : FROM java:openjdk-7-jre
---> b797b3ba124d
Step 1 : ENV ES_VER 1.3.4
---> Running in 4842001c48d0
---> 2717f23208b7
Removing intermediate container 4842001c48d0
Step 2 : ENV ES_URL https://download.elasticsearch.org/elasticsearch/elasticsearch/
elasticsearch-${ES_VER}.tar.gz
---> Running in b2f574153a18
---> a292b608b854
Removing intermediate container b2f574153a18
Step 3 : WORKDIR /opt/
---> Running in 0f138382e071
---> aa2ebf2e8061
Removing intermediate container 0f138382e071
Step 4 : RUN adduser --system elasticsearch
---> Running in 0800878ae8c0
---> 2b0c2619f328
Removing intermediate container 0800878ae8c0
Step 5 : RUN curl ${ES_URL} -o elasticsearch.tgz && tar xzf elasticsearch.tgz &&
ln -s elasticsearch-${ES_VER} elasticsearch && mkdir /opt/elasticsearch/data/ &&
chown elasticsearch /opt/elasticsearch/data/ && mkdir /opt/elasticsearch/logs/ &&
Postgresql Dockerfile
FROM postgres:9.2
ENV POSTGRES_USER customer
COPY testschema.sql /
COPY init-test-db.sh /docker-entrypoint-initdb.d/
Postgresql init file
#!/bin/bash
echo "#### Create test DB ####"
gosu postgres postgres --single <<EOF
CREATE USER customer PASSWORD 'customer';
CREATE DATABASE customer OWNER customer;
GRANT ALL PRIVILEGES ON DATABASE customer TO customer;
EOF
echo "#### Initialise test DB ####"
gosu postgres postgres --single customer -j < /testschema.sql
echo
echo "#### Test DB initialised ####"
Postgresql build
[ssmith] docker build -q --tag=postgres docker/postgres/
Sending build context to Docker daemon 5.12 kB
Sending build context to Docker daemon
Step 0 : FROM postgres:9.2
---> 898ba6de4072
Step 1 : ENV POSTGRES_USER customer
---> Running in 932957e34d5e
---> 91b679d67fd9
Removing intermediate container 932957e34d5e
Step 2 : COPY testschema.sql /
---> 65b67419fe54
Removing intermediate container 54298baaa088
Step 3 : COPY init-test-db.sh /docker-entrypoint-initdb.d/
---> b6d84236c1f7
Removing intermediate container f9000db9da92
Successfully built b6d84236c1f7
Transfer Dockerfile
FROM java:openjdk-7-jre
# Install netcat for waitport
RUN apt-get update && 
apt-get install -y netcat-openbsd && 
apt-get clean
COPY docker/waitport /usr/local/bin/
RUN curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -o /
usr/local/bin/lein && 
chmod a+rx /usr/local/bin/lein
RUN adduser --disabled-password --gecos '' transfer
ADD . /code
RUN chown -R transfer.transfer /code
USER transfer
WORKDIR /code
RUN lein deps
CMD waitport elasticsearch 9200 && 
waitport postgres 5432 && 
lein test-out junit
Running Tests Manually
Manual run
[ssmith] docker run -d —name=postgres postgres
181470ed78836c9285664c18f0d5b4c6a9069d28c4f71b9d621d4c24762ad938
[ssmith] docker run -d --name=elasticsearch elasticsearch
5718e1ba9b7caf0e25f53d803a128d2a3d4d518ae8d747b843cc2cbdd78620ce
[smith] docker run --link postgres:postgres --link elasticsearch:elasticsearch transfer
Waiting for TCP connection to elasticsearch:9200...OK
Waiting for TCP connection to postgres:5432...OK
Received notification for accountupdate for 55d3290b-5baa-4ca6-b353-cacf5b104c60
Performing update of 55d3290b-5baa-4ca6-b353-cacf5b104c60
Indexing row 55d3290b-5baa-4ca6-b353-cacf5b104c60 Mr. 55d3290b 55d3290b Esq.
Dispatch complete
Manual cleanup
[ssmith] docker ps
CONTAINER ID IMAGE COMMAND CREATED …
5718e1ba9b7c elasticsearch:latest "/bin/sh -c '/opt/el 5 minutes ago …
181470ed7883 postgres:latest "/docker-entrypoint. 6 minutes ago …
[ssmith] docker kill elasticsearch postgres
elasticsearch
postgres
[ssmith] docker ps
CONTAINER ID IMAGE COMMAND CREATED …
[ssmith] docker ps -a
CONTAINER ID IMAGE COMMAND CREATED
ff6e5409d8ba transfer:latest "/bin/sh -c 'waitpor 11 minutes ago
5718e1ba9b7c elasticsearch:latest "/bin/sh -c '/opt/el 11 minutes ago
181470ed7883 postgres:latest "/docker-entrypoint. 11 minutes ago
[smith] docker rm transfer postgres elasticsearch
transfer
postgres
elasticsearch
Simplifying with Compose
feedyourskull.com
Compose automates Docker
Compose
Declarative Deps Fetch Images Build Images
Link Containers
Our docker-compose.yml
transfer:
build: .
links:
- postgres
- elasticsearch
postgres:
build: docker/postgres
elasticsearch:
build: docker/elasticsearch
Compose Run
[ssmith] docker-compose up
Creating devweek15code_postgres_1...
Creating devweek15code_elasticsearch_1...
Creating devweek15code_transfer_1...
Attaching to devweek15code_postgres_1, devweek15code_elasticsearch_1, devweek15code_transfer_1
postgres_1 | The files belonging to this database system will be owned by user "postgres".
postgres_1 | This user must also own the server process.
<SNIP> <SNIP> <SNIP> <SNIP> <SNIP>
transfer_1 | Waiting for TCP connection to postgres:5432...OK
transfer_1 | Received notification for accountupdate for dcf286bf-7011-40f5-abb0-153d94acde
transfer_1 | Performing update of dcf286bf-7011-40f5-abb0-153d94acde69
transfer_1 | Indexing row dcf286bf-7011-40f5-abb0-153d94acde69 Mr. dcf286bf dcf286bf Esq.
elasticsearch_1 | creating index, cause [auto(index api)], shards [5]/[1], mappings []
elasticsearch_1 | update_mapping [account] (dynamic)
transfer_1 | Dispatch complete
devweek15code_transfer_1 exited with code 0
Gracefully stopping... (press Ctrl+C again to force)
Stopping devweek15code_elasticsearch_1...
Stopping devweek15code_postgres_1...
Compose Cleanup
[ssmith] docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------
devweek15code_elasticsearch_1 /bin/sh -c /opt/elasticsea ... Exit -1
devweek15code_postgres_1 /docker-entrypoint.sh postgres Exit 0
devweek15code_transfer_1 /bin/sh -c waitport elasti ... Exit 0
[ssmith] docker-compose rm —force
Going to remove devweek15code_transfer_1, devweek15code_elasticsearch_1, devweek15code_postgres_1
Removing devweek15code_postgres_1...
Removing devweek15code_elasticsearch_1...
Removing devweek15code_transfer_1…
[ssmith] docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------
[ssmith]
Discussion
Rafael Neff
Running With Bamboo
Plan
Stage
Job
Tasks
QA
Staging
Prod
Artifacts
Deployment
Environments
Git Repo
Bamboo Live
https://atlascamp2015.atlassian.net/
All New! Bamboo Docker Task!
AWS cloud agents with Docker
With Docker
Or create
your own
Require Docker support
Bamboo will start
on-demand
Building
Running
Linking
Compose with BambooSouth Florida
Classical Review
No Compose? No problem…
Running Compose
Cleaning up
Extracting ResultsAtlantic Sentinel
Fetching container files
[ssmith] docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------
devweek15code_elasticsearch_1 /bin/sh -c /opt/elasticsea ... Exit -1
devweek15code_postgres_1 /docker-entrypoint.sh postgres Exit 0
devweek15code_transfer_1 /bin/sh -c waitport elasti ... Exit 0
[ssmith] docker-compose ps -q transfer
fd7e728e3e9a361d96c253f5aeadab1a3506538d1b0e19d27c82848d9bf48bf8
[ssmith] ID=`docker-compose ps -q transfer`
[ssmith] docker cp $ID:/code/testreports.xml .
[ssmith] file testreports.xml
testreports.xml: XML document text
Fetching in Bamboo
Using JUnit Parser
Using JUnit results
Using JUnit results
Deployment Environments
Plan
Stage
Job
Tasks
QA
Staging
Prod
Artifacts
Deployment
Environments
Git Repo
Deployment Environments
QA
Staging
Prod
Artifacts
Deployment
Environments
Sharing Artifacts
Configuring the Environment
Configuring the Environment
Configuring the Environment
2
3
Useful Links
https://www.docker.com/subscribe_newsletter/
1 https://www.docker.com/
4 http://www.nkode.io/2014/08/24/valuable-docker-links.html
http://boot2docker.io/
Thank you!
STEVE SMITH • DEVOPS ADVOCATE • ATLASSIAN • @TARKASTEVE

More Related Content

What's hot

Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As CodeDevops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As CodeIsrael Shirk
 
Rise of the Machines - Automate your Development
Rise of the Machines - Automate your DevelopmentRise of the Machines - Automate your Development
Rise of the Machines - Automate your DevelopmentSven Peters
 
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build TimesUsing Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build TimesDevOps.com
 
DevOps with Serverless
DevOps with ServerlessDevOps with Serverless
DevOps with ServerlessYan Cui
 
Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for TestingCarlos Sanchez
 
Drone CI - Container native continuous Integration / Delivery
Drone CI - Container native continuous Integration / DeliveryDrone CI - Container native continuous Integration / Delivery
Drone CI - Container native continuous Integration / DeliveryPatrick Jahns
 
Continuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsContinuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsCamilo Ribeiro
 
Dev ops with smell v1.2
Dev ops with smell v1.2Dev ops with smell v1.2
Dev ops with smell v1.2Antons Kranga
 
Enabling Hybrid Workflows with Docker/Mesos @Orbitz
Enabling Hybrid Workflows with Docker/Mesos @OrbitzEnabling Hybrid Workflows with Docker/Mesos @Orbitz
Enabling Hybrid Workflows with Docker/Mesos @OrbitzSteve Hoffman
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with AnsibleMartin Etmajer
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Dockertoffermann
 
Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Yan Cui
 
FrenchKit 2017: Server(less) Swift
FrenchKit 2017: Server(less) SwiftFrenchKit 2017: Server(less) Swift
FrenchKit 2017: Server(less) SwiftChris Bailey
 
Drone your Ansible
Drone your AnsibleDrone your Ansible
Drone your AnsibleDennis Rowe
 
Hooking Docker With Selenium
Hooking Docker With SeleniumHooking Docker With Selenium
Hooking Docker With SeleniumSujith Vakathanam
 

What's hot (20)

Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As CodeDevops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
 
How Docker simplifies CI/CD
How Docker simplifies CI/CDHow Docker simplifies CI/CD
How Docker simplifies CI/CD
 
Rise of the Machines - Automate your Development
Rise of the Machines - Automate your DevelopmentRise of the Machines - Automate your Development
Rise of the Machines - Automate your Development
 
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build TimesUsing Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
 
DevOps with Serverless
DevOps with ServerlessDevOps with Serverless
DevOps with Serverless
 
Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for Testing
 
Where is my scalable API?
Where is my scalable API?Where is my scalable API?
Where is my scalable API?
 
Kloud
KloudKloud
Kloud
 
Drone CI - Container native continuous Integration / Delivery
Drone CI - Container native continuous Integration / DeliveryDrone CI - Container native continuous Integration / Delivery
Drone CI - Container native continuous Integration / Delivery
 
Continuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsContinuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and Jenkins
 
Dev ops with smell v1.2
Dev ops with smell v1.2Dev ops with smell v1.2
Dev ops with smell v1.2
 
Enabling Hybrid Workflows with Docker/Mesos @Orbitz
Enabling Hybrid Workflows with Docker/Mesos @OrbitzEnabling Hybrid Workflows with Docker/Mesos @Orbitz
Enabling Hybrid Workflows with Docker/Mesos @Orbitz
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
 
Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)
 
OpenWhisk
OpenWhiskOpenWhisk
OpenWhisk
 
FrenchKit 2017: Server(less) Swift
FrenchKit 2017: Server(less) SwiftFrenchKit 2017: Server(less) Swift
FrenchKit 2017: Server(less) Swift
 
Drone your Ansible
Drone your AnsibleDrone your Ansible
Drone your Ansible
 
Concourse updates
Concourse updatesConcourse updates
Concourse updates
 
Hooking Docker With Selenium
Hooking Docker With SeleniumHooking Docker With Selenium
Hooking Docker With Selenium
 

Viewers also liked

LCE13: Overview of Linaro Project Management Methodology
LCE13: Overview of Linaro Project Management MethodologyLCE13: Overview of Linaro Project Management Methodology
LCE13: Overview of Linaro Project Management MethodologyLinaro
 
Practical Continuous Deployment, Devoxx UK 2015
Practical Continuous Deployment, Devoxx UK 2015Practical Continuous Deployment, Devoxx UK 2015
Practical Continuous Deployment, Devoxx UK 2015Steve Smith
 
DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerSteve Smith
 
Continuous talk, AnsibleFest London 2016
Continuous talk, AnsibleFest London 2016Continuous talk, AnsibleFest London 2016
Continuous talk, AnsibleFest London 2016Steve Smith
 
Understanding git: Voxxed Vienna 2016
Understanding git: Voxxed Vienna 2016Understanding git: Voxxed Vienna 2016
Understanding git: Voxxed Vienna 2016Steve Smith
 
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...Peter Leschev
 

Viewers also liked (6)

LCE13: Overview of Linaro Project Management Methodology
LCE13: Overview of Linaro Project Management MethodologyLCE13: Overview of Linaro Project Management Methodology
LCE13: Overview of Linaro Project Management Methodology
 
Practical Continuous Deployment, Devoxx UK 2015
Practical Continuous Deployment, Devoxx UK 2015Practical Continuous Deployment, Devoxx UK 2015
Practical Continuous Deployment, Devoxx UK 2015
 
DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to Docker
 
Continuous talk, AnsibleFest London 2016
Continuous talk, AnsibleFest London 2016Continuous talk, AnsibleFest London 2016
Continuous talk, AnsibleFest London 2016
 
Understanding git: Voxxed Vienna 2016
Understanding git: Voxxed Vienna 2016Understanding git: Voxxed Vienna 2016
Understanding git: Voxxed Vienna 2016
 
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
 

Similar to AtlasCamp 2015 Docker continuous integration training

Docker command
Docker commandDocker command
Docker commandEric Ahn
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in descriptionPrzemyslaw Koltermann
 
Using Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutionsUsing Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutionsSander van der Burg
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDocker, Inc.
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Ontico
 
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017Amazon Web Services Korea
 
Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK SeminarMartin Scharm
 
Dockerize everything TopConf Tallinn
Dockerize everything TopConf TallinnDockerize everything TopConf Tallinn
Dockerize everything TopConf TallinnThomas Einwaller
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with DockerDocker, Inc.
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Praguetomasbart
 
Chris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialChris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialCohesive Networks
 
Docker Registry + Basic Auth
Docker Registry + Basic AuthDocker Registry + Basic Auth
Docker Registry + Basic AuthRemotty
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOpsandersjanmyr
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4Hojin Kim
 

Similar to AtlasCamp 2015 Docker continuous integration training (20)

Docker command
Docker commandDocker command
Docker command
 
Docker: ao vivo e a cores
Docker: ao vivo e a coresDocker: ao vivo e a cores
Docker: ao vivo e a cores
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
 
Using Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutionsUsing Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutions
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
Docker practice
Docker practiceDocker practice
Docker practice
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
 
Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK Seminar
 
Dockerize everything TopConf Tallinn
Dockerize everything TopConf TallinnDockerize everything TopConf Tallinn
Dockerize everything TopConf Tallinn
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Chris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialChris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks Tutorial
 
vBACD - Introduction to Opscode Chef - 2/29
vBACD - Introduction to Opscode Chef - 2/29vBACD - Introduction to Opscode Chef - 2/29
vBACD - Introduction to Opscode Chef - 2/29
 
Docker Registry + Basic Auth
Docker Registry + Basic AuthDocker Registry + Basic Auth
Docker Registry + Basic Auth
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4
 

More from Steve Smith

Knowledge is Power: Getting out of trouble by understanding Git
Knowledge is Power: Getting out of trouble by understanding GitKnowledge is Power: Getting out of trouble by understanding Git
Knowledge is Power: Getting out of trouble by understanding GitSteve Smith
 
Understanding Git - GOTO London 2015
Understanding Git - GOTO London 2015Understanding Git - GOTO London 2015
Understanding Git - GOTO London 2015Steve Smith
 
London Atlassian User Group - February 2014
London Atlassian User Group - February 2014London Atlassian User Group - February 2014
London Atlassian User Group - February 2014Steve Smith
 
Accessgrid XMPP rationale
Accessgrid XMPP rationaleAccessgrid XMPP rationale
Accessgrid XMPP rationaleSteve Smith
 
Accessgrid XMPP implementation
Accessgrid XMPP implementationAccessgrid XMPP implementation
Accessgrid XMPP implementationSteve Smith
 
Vislab presentation
Vislab presentationVislab presentation
Vislab presentationSteve Smith
 
APAC-05 XMPP AccessGrid presentation
APAC-05 XMPP AccessGrid presentationAPAC-05 XMPP AccessGrid presentation
APAC-05 XMPP AccessGrid presentationSteve Smith
 
Sydgraph presentation 2004
Sydgraph presentation 2004Sydgraph presentation 2004
Sydgraph presentation 2004Steve Smith
 
Devops London 2013 - Opening the inner circle
Devops London 2013 - Opening the inner circleDevops London 2013 - Opening the inner circle
Devops London 2013 - Opening the inner circleSteve Smith
 
Devops London 2013 - Robust systems or, not fucking the customer
Devops London 2013 - Robust systems or, not fucking the customerDevops London 2013 - Robust systems or, not fucking the customer
Devops London 2013 - Robust systems or, not fucking the customerSteve Smith
 

More from Steve Smith (10)

Knowledge is Power: Getting out of trouble by understanding Git
Knowledge is Power: Getting out of trouble by understanding GitKnowledge is Power: Getting out of trouble by understanding Git
Knowledge is Power: Getting out of trouble by understanding Git
 
Understanding Git - GOTO London 2015
Understanding Git - GOTO London 2015Understanding Git - GOTO London 2015
Understanding Git - GOTO London 2015
 
London Atlassian User Group - February 2014
London Atlassian User Group - February 2014London Atlassian User Group - February 2014
London Atlassian User Group - February 2014
 
Accessgrid XMPP rationale
Accessgrid XMPP rationaleAccessgrid XMPP rationale
Accessgrid XMPP rationale
 
Accessgrid XMPP implementation
Accessgrid XMPP implementationAccessgrid XMPP implementation
Accessgrid XMPP implementation
 
Vislab presentation
Vislab presentationVislab presentation
Vislab presentation
 
APAC-05 XMPP AccessGrid presentation
APAC-05 XMPP AccessGrid presentationAPAC-05 XMPP AccessGrid presentation
APAC-05 XMPP AccessGrid presentation
 
Sydgraph presentation 2004
Sydgraph presentation 2004Sydgraph presentation 2004
Sydgraph presentation 2004
 
Devops London 2013 - Opening the inner circle
Devops London 2013 - Opening the inner circleDevops London 2013 - Opening the inner circle
Devops London 2013 - Opening the inner circle
 
Devops London 2013 - Robust systems or, not fucking the customer
Devops London 2013 - Robust systems or, not fucking the customerDevops London 2013 - Robust systems or, not fucking the customer
Devops London 2013 - Robust systems or, not fucking the customer
 

Recently uploaded

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

AtlasCamp 2015 Docker continuous integration training

  • 1. Continuous Integration with Docker and Bamboo STEVE SMITH • DEVOPS ADVOCATE • ATLASSIAN • @TARKASTEVE https://bitbucket.org/ssmith/atlascamp2015-docker-ci
  • 5. Virtual Machine Virtual HW BIOS/EFI Guest FS / Kernel Applications Physical Hardware Host FS / Kernel VM Hypervisor BIOS/EFI Virtual HW BIOS/EFI Guest FS / Kernel Applications
  • 6. Containers / Docker Physical Hardware Host FS / Kernel Docker Engine BIOS/EFI Guest FS Application Guest FS Application Virtual HW BIOS/EFI Guest FS / Kernel Applications Physical Hardware Host FS / Kernel VM Hypervisor BIOS/EFI Virtual HW BIOS/EFI Guest FS / Kernel Applications
  • 7. Using features of the Linux kernel Docker libcontainer systemd nspawn libvirt cgroups CPU accounting Namespaces Posix capabilities btrfs OverlayFS LXC
  • 9. Containers take this further… Network Abstraction Process Isolation Filesystem Isolation Resource Limits
  • 10. Docker takes this to the next level… Build Tools Packaging Lifecycle Communication Dev (boot2docker) Sharing
  • 11. boot2docker Virtual Hardware Host FS / Kernel BIOS/EFI Guest FS Application Guest FS Application
  • 14. Docker containers are like OO classes… Inheritance Sourcefile (Dockerfile) Compile Dep. Injection Declarative Deps
  • 15. FROM ubuntu:trusty RUN apt-get update && apt-get install -y nginx && apt-get clean EXPOSE 80 EXPOSE 443 CMD nginx -g daemon off; Single inheritance Add member Override parent behaviour Exposed linking points Dockerfile ~= Sourcefile
  • 16. Inheritance resolved at runtime Ubuntu Add nginx Add run command (sorta like JVM class assembly) Union Filesystem - AUFS - BTRFS - Devicemapper - OverlayFS
  • 17. ‘run’ instantiates a new container Ubuntu Add nginx Add run command Writable Immutable (kinda like ‘new’) Runtime layer
  • 18. [ssmith] $ docker build -q --tag=mynginx docker/mynginx/ Sending build context to Docker daemon 12.72 MB Sending build context to Docker daemon Step 0 : FROM ubuntu:trusty ---> 8eaa4ff06b53 Step 1 : RUN apt-get update && apt-get install -y nginx && apt-get clea ---> Running in f05a4a034fe3 ---> 1e84ac75dd9a Removing intermediate container f05a4a034fe3 Step 2 : EXPOSE 80 ---> Running in 77602b8eb9ec ---> 4076f56233ff Removing intermediate container 77602b8eb9ec Step 3 : EXPOSE 443 ---> Running in b627b8c1d328 ---> f5a3ff140964 Removing intermediate container b627b8c1d328 Step 4 : CMD nginx -g daemon off; ---> Running in 132573fe4fc9 ---> c1df0408cf70 ‘build’ compiles to binary
  • 19. Inspecting the stack [ssmith] $ docker history mynginx IMAGE CREATED CREATED BY 606f0f611cb2 6 days ago /bin/sh -c #(nop) CMD [nginx -g daemon off;] 27d0fad8620d 6 days ago /bin/sh -c #(nop) EXPOSE map[443/tcp:{}] dc26b50e9806 6 days ago /bin/sh -c #(nop) EXPOSE map[80/tcp:{}] 7a04b014a0a7 6 days ago /bin/sh -c apt-get update && apt-get install b39b81afc8ca 9 days ago /bin/sh -c #(nop) CMD [/bin/bash] 615c102e2290 9 days ago /bin/sh -c sed -i 's/^#s*(deb.*universe)$/ 837339b91538 9 days ago /bin/sh -c echo '#!/bin/sh' > /usr/sbin/polic 53f858aaaf03 9 days ago /bin/sh -c #(nop) ADD file:ca5b63647c6b7a419e 511136ea3c5a 19 months ago
  • 20. Linked Containers (dependency injection; sort-of…) Docker host postgresql client --link postgresql:pg can refer to hostname pg in commands
  • 25. The example project Transfer Trigger / Async Data Data (See http://bit.do/postgres-es for details)
  • 27. Docker testing Reuse images Startup speed Idempotent tests Dev / Test match Deploy to Docker
  • 29. Elasticsearch Dockerfile FROM java:openjdk-7-jre ENV ES_VER 1.3.4 ENV ES_URL https://download.elasticsearch.org/elasticsearch/elasticsearch/ elasticsearch-${ES_VER}.tar.gz WORKDIR /opt/ RUN adduser --system elasticsearch RUN curl ${ES_URL} -o elasticsearch.tgz && tar xzf elasticsearch.tgz && ln -s elasticsearch-${ES_VER} elasticsearch && mkdir /opt/elasticsearch/data/ && chown elasticsearch /opt/elasticsearch/data/ && mkdir /opt/elasticsearch/logs/ && chown elasticsearch /opt/elasticsearch/logs/ && rm elasticsearch.tgz EXPOSE 9200 EXPOSE 9300 USER elasticsearch CMD /opt/elasticsearch/bin/elasticsearch -f
  • 30. Elasticsearch build [ssmith] docker build -q --tag=elasticsearch docker/elasticsearch/ Sending build context to Docker daemon 2.56 kB Sending build context to Docker daemon Step 0 : FROM java:openjdk-7-jre ---> b797b3ba124d Step 1 : ENV ES_VER 1.3.4 ---> Running in 4842001c48d0 ---> 2717f23208b7 Removing intermediate container 4842001c48d0 Step 2 : ENV ES_URL https://download.elasticsearch.org/elasticsearch/elasticsearch/ elasticsearch-${ES_VER}.tar.gz ---> Running in b2f574153a18 ---> a292b608b854 Removing intermediate container b2f574153a18 Step 3 : WORKDIR /opt/ ---> Running in 0f138382e071 ---> aa2ebf2e8061 Removing intermediate container 0f138382e071 Step 4 : RUN adduser --system elasticsearch ---> Running in 0800878ae8c0 ---> 2b0c2619f328 Removing intermediate container 0800878ae8c0 Step 5 : RUN curl ${ES_URL} -o elasticsearch.tgz && tar xzf elasticsearch.tgz && ln -s elasticsearch-${ES_VER} elasticsearch && mkdir /opt/elasticsearch/data/ && chown elasticsearch /opt/elasticsearch/data/ && mkdir /opt/elasticsearch/logs/ &&
  • 31. Postgresql Dockerfile FROM postgres:9.2 ENV POSTGRES_USER customer COPY testschema.sql / COPY init-test-db.sh /docker-entrypoint-initdb.d/
  • 32. Postgresql init file #!/bin/bash echo "#### Create test DB ####" gosu postgres postgres --single <<EOF CREATE USER customer PASSWORD 'customer'; CREATE DATABASE customer OWNER customer; GRANT ALL PRIVILEGES ON DATABASE customer TO customer; EOF echo "#### Initialise test DB ####" gosu postgres postgres --single customer -j < /testschema.sql echo echo "#### Test DB initialised ####"
  • 33. Postgresql build [ssmith] docker build -q --tag=postgres docker/postgres/ Sending build context to Docker daemon 5.12 kB Sending build context to Docker daemon Step 0 : FROM postgres:9.2 ---> 898ba6de4072 Step 1 : ENV POSTGRES_USER customer ---> Running in 932957e34d5e ---> 91b679d67fd9 Removing intermediate container 932957e34d5e Step 2 : COPY testschema.sql / ---> 65b67419fe54 Removing intermediate container 54298baaa088 Step 3 : COPY init-test-db.sh /docker-entrypoint-initdb.d/ ---> b6d84236c1f7 Removing intermediate container f9000db9da92 Successfully built b6d84236c1f7
  • 34. Transfer Dockerfile FROM java:openjdk-7-jre # Install netcat for waitport RUN apt-get update && apt-get install -y netcat-openbsd && apt-get clean COPY docker/waitport /usr/local/bin/ RUN curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -o / usr/local/bin/lein && chmod a+rx /usr/local/bin/lein RUN adduser --disabled-password --gecos '' transfer ADD . /code RUN chown -R transfer.transfer /code USER transfer WORKDIR /code RUN lein deps CMD waitport elasticsearch 9200 && waitport postgres 5432 && lein test-out junit
  • 36. Manual run [ssmith] docker run -d —name=postgres postgres 181470ed78836c9285664c18f0d5b4c6a9069d28c4f71b9d621d4c24762ad938 [ssmith] docker run -d --name=elasticsearch elasticsearch 5718e1ba9b7caf0e25f53d803a128d2a3d4d518ae8d747b843cc2cbdd78620ce [smith] docker run --link postgres:postgres --link elasticsearch:elasticsearch transfer Waiting for TCP connection to elasticsearch:9200...OK Waiting for TCP connection to postgres:5432...OK Received notification for accountupdate for 55d3290b-5baa-4ca6-b353-cacf5b104c60 Performing update of 55d3290b-5baa-4ca6-b353-cacf5b104c60 Indexing row 55d3290b-5baa-4ca6-b353-cacf5b104c60 Mr. 55d3290b 55d3290b Esq. Dispatch complete
  • 37. Manual cleanup [ssmith] docker ps CONTAINER ID IMAGE COMMAND CREATED … 5718e1ba9b7c elasticsearch:latest "/bin/sh -c '/opt/el 5 minutes ago … 181470ed7883 postgres:latest "/docker-entrypoint. 6 minutes ago … [ssmith] docker kill elasticsearch postgres elasticsearch postgres [ssmith] docker ps CONTAINER ID IMAGE COMMAND CREATED … [ssmith] docker ps -a CONTAINER ID IMAGE COMMAND CREATED ff6e5409d8ba transfer:latest "/bin/sh -c 'waitpor 11 minutes ago 5718e1ba9b7c elasticsearch:latest "/bin/sh -c '/opt/el 11 minutes ago 181470ed7883 postgres:latest "/docker-entrypoint. 11 minutes ago [smith] docker rm transfer postgres elasticsearch transfer postgres elasticsearch
  • 40. Compose Declarative Deps Fetch Images Build Images Link Containers
  • 41. Our docker-compose.yml transfer: build: . links: - postgres - elasticsearch postgres: build: docker/postgres elasticsearch: build: docker/elasticsearch
  • 42. Compose Run [ssmith] docker-compose up Creating devweek15code_postgres_1... Creating devweek15code_elasticsearch_1... Creating devweek15code_transfer_1... Attaching to devweek15code_postgres_1, devweek15code_elasticsearch_1, devweek15code_transfer_1 postgres_1 | The files belonging to this database system will be owned by user "postgres". postgres_1 | This user must also own the server process. <SNIP> <SNIP> <SNIP> <SNIP> <SNIP> transfer_1 | Waiting for TCP connection to postgres:5432...OK transfer_1 | Received notification for accountupdate for dcf286bf-7011-40f5-abb0-153d94acde transfer_1 | Performing update of dcf286bf-7011-40f5-abb0-153d94acde69 transfer_1 | Indexing row dcf286bf-7011-40f5-abb0-153d94acde69 Mr. dcf286bf dcf286bf Esq. elasticsearch_1 | creating index, cause [auto(index api)], shards [5]/[1], mappings [] elasticsearch_1 | update_mapping [account] (dynamic) transfer_1 | Dispatch complete devweek15code_transfer_1 exited with code 0 Gracefully stopping... (press Ctrl+C again to force) Stopping devweek15code_elasticsearch_1... Stopping devweek15code_postgres_1...
  • 43. Compose Cleanup [ssmith] docker-compose ps Name Command State Ports -------------------------------------------------------------------------------- devweek15code_elasticsearch_1 /bin/sh -c /opt/elasticsea ... Exit -1 devweek15code_postgres_1 /docker-entrypoint.sh postgres Exit 0 devweek15code_transfer_1 /bin/sh -c waitport elasti ... Exit 0 [ssmith] docker-compose rm —force Going to remove devweek15code_transfer_1, devweek15code_elasticsearch_1, devweek15code_postgres_1 Removing devweek15code_postgres_1... Removing devweek15code_elasticsearch_1... Removing devweek15code_transfer_1… [ssmith] docker-compose ps Name Command State Ports -------------------------------------------------------------------------------- [ssmith]
  • 47. All New! Bamboo Docker Task!
  • 48. AWS cloud agents with Docker With Docker Or create your own
  • 49. Require Docker support Bamboo will start on-demand
  • 53. Compose with BambooSouth Florida Classical Review
  • 54. No Compose? No problem…
  • 58. Fetching container files [ssmith] docker-compose ps Name Command State Ports -------------------------------------------------------------------------------- devweek15code_elasticsearch_1 /bin/sh -c /opt/elasticsea ... Exit -1 devweek15code_postgres_1 /docker-entrypoint.sh postgres Exit 0 devweek15code_transfer_1 /bin/sh -c waitport elasti ... Exit 0 [ssmith] docker-compose ps -q transfer fd7e728e3e9a361d96c253f5aeadab1a3506538d1b0e19d27c82848d9bf48bf8 [ssmith] ID=`docker-compose ps -q transfer` [ssmith] docker cp $ID:/code/testreports.xml . [ssmith] file testreports.xml testreports.xml: XML document text
  • 69. 2 3 Useful Links https://www.docker.com/subscribe_newsletter/ 1 https://www.docker.com/ 4 http://www.nkode.io/2014/08/24/valuable-docker-links.html http://boot2docker.io/
  • 70. Thank you! STEVE SMITH • DEVOPS ADVOCATE • ATLASSIAN • @TARKASTEVE