SlideShare a Scribd company logo
1 of 22
1
Container-SIG#1
10/7/2016
Naoya Hashimoto
Ansible Container
Table of contents
• What is Ansible Container?
• Why Ansible Container Project begins?
• How to use ansible-container?
• Ansible Container Demonstration
2
Ansible Container?
3
ansible-container
shipit
push
build
run
build, run, push and shipit
init
docker-compose?
5
Feature
• Docker ImageのビルドはDockerfileからPlaybookへ
• Playbook=Ansible Moduleでビルド/デプロイ
• PlaybookはYAML形式、docker-composeユーザに優しい
6
ansible-container init (ver 0.1)
7
$ ansible-container init
$ tree ansible
ansible/
├── container.yml
├── main.yml
└── requirements.txt
ansible-container init
8
container.yml
• Dockerfileやdocker-compose.ymlに相当
• Imageやバージョン、マップするポート、環境変数などを定義
main.yml
• Master Playbook (site.yml)に相当
• イメージをビルドする際に実行するAnsibleのRoleやTaskを定義
• container.ymlが自動で生成したインベントリを参照
requirements.txt
• イメージをビルドする際に必要なPythonライブラリを定義
• pipのフォーマットに準拠
ansible-container init (ver 0.2)
9
$ ansible-container init
$ tree ansible
ansible/
├── ansible.cfg
├── container.yml
├── main.yml
├── meta.yml
├── requirements.txt
└── requirements.yml
Why Ansible Container
Project begins?
10
Ansible Container Project
“5 REASONS WE STARTED THE ANSIBLE
CONTAINER PROJECT”
https://www.ansible.com/blog/ansible-container-project
1. Because our community has been using Ansible to manage
containers for quite a while now.
2. Because the new Docker connection plug-in makes it far simpler
to run Ansible against a Docker container.
3. Because shell scripts aren’t good enough.
4. Because Ansible can be a great bridge to larger-scale container
orchestration.
5. Because we believe that communities make the best software.
11
Ansible Community & Docker
Docker ContainerをPlaybookで管理
• Docker Hubに公開しているAnsibleのイメージは約1,000件に
• メンバーが様々なDocker ContainerのベストプラクティスをBlog
に公開
• 集約されたナレッジをツールとして開発する流れに
Docker Moduleや機能を拡張
• Docker ModuleがAnsible Moduleの中で最も利用される
• Connection PluginにDocker Connection Pluginをリリース
• 初期のDocker ModuleはDeprecated
https://docs.ansible.com/ansible/guide_docker.html
• 2.2からdocker_containerやdocker_imageに置き換え
https://github.com/ansible/ansible-modules-
core/blob/devel/cloud/docker/_docker.py
12
Ansible Docker Modules & Plugins
13
Version Module/Plugin Feature
1.4
(2013)
docker
(Deprecated)
Docker Moduleのオリジナル
docker build, load, pull, push, tagなどに相当
1.6 Dynamic Inventory Docker ContainerのInventoryを動的に生成
2.0 Docker Connection Docker Containerにsshを利用せずに接続
2.0 docker_login docker login に相当
2.1 docker_service docker-composeに相当, version 1, 2に対応
2.1 docker_container Docker Containerをデプロイ
2.1 docker_image_facts Docker HostでキャッシュしたDockerイメージを
Inspect, Factsなどに利用
2.2
(2016)
docker_network docker network に相当
Docker Connection Plugin
14
Ansible 2.1でDocker Connection Pluginをリリース
• Connection DriverにDocker Connection Pluginを指定
• Playbookの実行にdocker execを利用
• PlaybookはVM, Containerで互換性を保てる?
2.1
sshd
app app
End the bash madness
15
"Ansible Container represents an end to the command
&& command && command (and so on) syntax you’ve
been struggling with to build containers.”
https://www.ansible.com/ansible-container
# grab tini for signal processing and zombie killing
ENV TINI_VERSION v0.9.0
RUN set -x 
&& curl -fSL "https://$URI/$TINI_VERSION/tini" -o /usr/local/bin/tini 
&& curl -fSL "https://$URI/$TINI_VERSION/tini.asc" -o /usr/local/bin/tini.asc 
&& export GNUPGHOME="$(mktemp -d)" 
&& gpg --keyserver ha.pool.sks-keyservers.net 
--recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5 
&& gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini 
&& rm -r "$GNUPGHOME" /usr/local/bin/tini.asc 
&& chmod +x /usr/local/bin/tini 
&& tini -h
How to use
ansible-container?
16
Usage: $ ansible-container --help
17
Command Docker Command Feature
init ansible-garaxy init テンプレートを生成
build docker build
docker-compose build
Docker Imageをビルド
run docker run
docker-compose up
Docker Containerを起動
push docker push Docker RegistryにImageを
プッシュ
shipit oc new-app
oc run
オーケストレーション環境に
デプロイ
e.g. Kubernetes, OpenShift
Ansible Container Examples
18
https://github.com/ansible/ansible-container-examples
Demonstration
19
build & run
20
Prerequisites
• Python 2.7
• pip
• setuptools 20.0.0+
• Docker 1.11 or access to a Docker daemon.
Installation
$ sudo pip install ansible-container
$ ansible-container version
Build & Run
$ git clone https://github.com/ansible/ansible-container-examples.git
$ cd ansible-container-examples/ ; cp -r helloworld-nginx/ ansible
$ ansible-container build
$ ansible-container run –d
$ ansible-container stop
Push
$ docker login
$ ansible-container push
Reference
21
Ansible Container
https://github.com/ansible/ansible-container
Documentation
https://www.ansible.com/ansible-container
ansible-container-examples
https://github.com/ansible/ansible-container-examples
5 REASONS WE STARTED THE ANSIBLE CONTAINER PROJECT
https://www.ansible.com/blog/ansible-container-project
6 WAYS ANSIBLE MAKES DOCKER-COMPOSE BETTER
https://www.ansible.com/blog/six-ways-ansible-makes-docker-compose-
better
ANSIBLE AND CONTAINERS: WHY AND HOW
https://www.ansible.com/blog/ansible-and-containers-why-and-how
Q&A
22

More Related Content

What's hot

Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班Philip Zheng
 
Introduction to Project atomic (CentOS Dojo Bangalore)
Introduction to Project atomic (CentOS Dojo Bangalore)Introduction to Project atomic (CentOS Dojo Bangalore)
Introduction to Project atomic (CentOS Dojo Bangalore)Lalatendu Mohanty
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇Philip Zheng
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesLuciano Fiandesio
 
Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Bill Maxwell
 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveKazuto Kusama
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017Paul Chao
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructureDaegwon Kim
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdockerJaehwa Park
 
The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...Sébastien Portebois
 
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発Yahoo!デベロッパーネットワーク
 
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングCoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングYuji ODA
 
容器與資料科學應用
容器與資料科學應用容器與資料科學應用
容器與資料科學應用Philip Zheng
 
[KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
 [KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui... [KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
[KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...Akihiro Suda
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Chu-Siang Lai
 
The State of Rootless Containers
The State of Rootless ContainersThe State of Rootless Containers
The State of Rootless ContainersAkihiro Suda
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Paul Chao
 

What's hot (20)

Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
 
Introduction to Project atomic (CentOS Dojo Bangalore)
Introduction to Project atomic (CentOS Dojo Bangalore)Introduction to Project atomic (CentOS Dojo Bangalore)
Introduction to Project atomic (CentOS Dojo Bangalore)
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
Docker研習營
Docker研習營Docker研習營
Docker研習營
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Austin - Container Days - Docker 101
Austin - Container Days - Docker 101
 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep Dive
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
 
Tech Talk - Vagrant
Tech Talk - VagrantTech Talk - Vagrant
Tech Talk - Vagrant
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
 
The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...
 
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
 
Docker
DockerDocker
Docker
 
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングCoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
 
容器與資料科學應用
容器與資料科學應用容器與資料科學應用
容器與資料科學應用
 
[KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
 [KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui... [KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
[KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
 
The State of Rootless Containers
The State of Rootless ContainersThe State of Rootless Containers
The State of Rootless Containers
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
 

Similar to Container sig#1 ansible-container

PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoHannes Hapke
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014Rafe Colton
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...Docker, Inc.
 
Docker in Action
Docker in ActionDocker in Action
Docker in ActionAlper Kanat
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageAlessandro Cinelli (cirpo)
 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesArun Gupta
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortalsHenryk Konsek
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Partner S.A.
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with dockerMichelle Liu
 
DockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDocker, Inc.
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDocker, Inc.
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
Next in Virtualization Era: Containerization & Docker
Next in Virtualization Era: Containerization & DockerNext in Virtualization Era: Containerization & Docker
Next in Virtualization Era: Containerization & DockerAlper Kanat
 
Introduction to Docker and deployment and Azure
Introduction to Docker and deployment and AzureIntroduction to Docker and deployment and Azure
Introduction to Docker and deployment and AzureJérôme Petazzoni
 
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes][HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]Wong Hoi Sing Edison
 

Similar to Container sig#1 ansible-container (20)

PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Docker 101
Docker 101 Docker 101
Docker 101
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stage
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and Kubernetes
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Ansible container
Ansible containerAnsible container
Ansible container
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
 
The Docker Ecosystem
The Docker EcosystemThe Docker Ecosystem
The Docker Ecosystem
 
DockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with Docker
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
Next in Virtualization Era: Containerization & Docker
Next in Virtualization Era: Containerization & DockerNext in Virtualization Era: Containerization & Docker
Next in Virtualization Era: Containerization & Docker
 
Introduction to Docker and deployment and Azure
Introduction to Docker and deployment and AzureIntroduction to Docker and deployment and Azure
Introduction to Docker and deployment and Azure
 
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes][HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
 

More from Naoya Hashimoto

OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)Naoya Hashimoto
 
Aws wordpress migration@4th i jaws
Aws wordpress migration@4th i jawsAws wordpress migration@4th i jaws
Aws wordpress migration@4th i jawsNaoya Hashimoto
 
Aws ebs snapshot with iam cross account access
Aws ebs snapshot with iam cross account accessAws ebs snapshot with iam cross account access
Aws ebs snapshot with iam cross account accessNaoya Hashimoto
 
AWS CloudFormation template with single & redundant system
AWS CloudFormation template with single & redundant systemAWS CloudFormation template with single & redundant system
AWS CloudFormation template with single & redundant systemNaoya Hashimoto
 
Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014Naoya Hashimoto
 
Aws向け監視ソリューション比較
Aws向け監視ソリューション比較Aws向け監視ソリューション比較
Aws向け監視ソリューション比較Naoya Hashimoto
 
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測Naoya Hashimoto
 
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編Naoya Hashimoto
 
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』Naoya Hashimoto
 

More from Naoya Hashimoto (10)

OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)
 
Ansible container
Ansible containerAnsible container
Ansible container
 
Aws wordpress migration@4th i jaws
Aws wordpress migration@4th i jawsAws wordpress migration@4th i jaws
Aws wordpress migration@4th i jaws
 
Aws ebs snapshot with iam cross account access
Aws ebs snapshot with iam cross account accessAws ebs snapshot with iam cross account access
Aws ebs snapshot with iam cross account access
 
AWS CloudFormation template with single & redundant system
AWS CloudFormation template with single & redundant systemAWS CloudFormation template with single & redundant system
AWS CloudFormation template with single & redundant system
 
Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014
 
Aws向け監視ソリューション比較
Aws向け監視ソリューション比較Aws向け監視ソリューション比較
Aws向け監視ソリューション比較
 
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
 
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
 
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
 

Recently uploaded

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 

Container sig#1 ansible-container

  • 2. Table of contents • What is Ansible Container? • Why Ansible Container Project begins? • How to use ansible-container? • Ansible Container Demonstration 2
  • 6. Feature • Docker ImageのビルドはDockerfileからPlaybookへ • Playbook=Ansible Moduleでビルド/デプロイ • PlaybookはYAML形式、docker-composeユーザに優しい 6
  • 7. ansible-container init (ver 0.1) 7 $ ansible-container init $ tree ansible ansible/ ├── container.yml ├── main.yml └── requirements.txt
  • 8. ansible-container init 8 container.yml • Dockerfileやdocker-compose.ymlに相当 • Imageやバージョン、マップするポート、環境変数などを定義 main.yml • Master Playbook (site.yml)に相当 • イメージをビルドする際に実行するAnsibleのRoleやTaskを定義 • container.ymlが自動で生成したインベントリを参照 requirements.txt • イメージをビルドする際に必要なPythonライブラリを定義 • pipのフォーマットに準拠
  • 9. ansible-container init (ver 0.2) 9 $ ansible-container init $ tree ansible ansible/ ├── ansible.cfg ├── container.yml ├── main.yml ├── meta.yml ├── requirements.txt └── requirements.yml
  • 11. Ansible Container Project “5 REASONS WE STARTED THE ANSIBLE CONTAINER PROJECT” https://www.ansible.com/blog/ansible-container-project 1. Because our community has been using Ansible to manage containers for quite a while now. 2. Because the new Docker connection plug-in makes it far simpler to run Ansible against a Docker container. 3. Because shell scripts aren’t good enough. 4. Because Ansible can be a great bridge to larger-scale container orchestration. 5. Because we believe that communities make the best software. 11
  • 12. Ansible Community & Docker Docker ContainerをPlaybookで管理 • Docker Hubに公開しているAnsibleのイメージは約1,000件に • メンバーが様々なDocker ContainerのベストプラクティスをBlog に公開 • 集約されたナレッジをツールとして開発する流れに Docker Moduleや機能を拡張 • Docker ModuleがAnsible Moduleの中で最も利用される • Connection PluginにDocker Connection Pluginをリリース • 初期のDocker ModuleはDeprecated https://docs.ansible.com/ansible/guide_docker.html • 2.2からdocker_containerやdocker_imageに置き換え https://github.com/ansible/ansible-modules- core/blob/devel/cloud/docker/_docker.py 12
  • 13. Ansible Docker Modules & Plugins 13 Version Module/Plugin Feature 1.4 (2013) docker (Deprecated) Docker Moduleのオリジナル docker build, load, pull, push, tagなどに相当 1.6 Dynamic Inventory Docker ContainerのInventoryを動的に生成 2.0 Docker Connection Docker Containerにsshを利用せずに接続 2.0 docker_login docker login に相当 2.1 docker_service docker-composeに相当, version 1, 2に対応 2.1 docker_container Docker Containerをデプロイ 2.1 docker_image_facts Docker HostでキャッシュしたDockerイメージを Inspect, Factsなどに利用 2.2 (2016) docker_network docker network に相当
  • 14. Docker Connection Plugin 14 Ansible 2.1でDocker Connection Pluginをリリース • Connection DriverにDocker Connection Pluginを指定 • Playbookの実行にdocker execを利用 • PlaybookはVM, Containerで互換性を保てる? 2.1 sshd app app
  • 15. End the bash madness 15 "Ansible Container represents an end to the command && command && command (and so on) syntax you’ve been struggling with to build containers.” https://www.ansible.com/ansible-container # grab tini for signal processing and zombie killing ENV TINI_VERSION v0.9.0 RUN set -x && curl -fSL "https://$URI/$TINI_VERSION/tini" -o /usr/local/bin/tini && curl -fSL "https://$URI/$TINI_VERSION/tini.asc" -o /usr/local/bin/tini.asc && export GNUPGHOME="$(mktemp -d)" && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5 && gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini && rm -r "$GNUPGHOME" /usr/local/bin/tini.asc && chmod +x /usr/local/bin/tini && tini -h
  • 17. Usage: $ ansible-container --help 17 Command Docker Command Feature init ansible-garaxy init テンプレートを生成 build docker build docker-compose build Docker Imageをビルド run docker run docker-compose up Docker Containerを起動 push docker push Docker RegistryにImageを プッシュ shipit oc new-app oc run オーケストレーション環境に デプロイ e.g. Kubernetes, OpenShift
  • 20. build & run 20 Prerequisites • Python 2.7 • pip • setuptools 20.0.0+ • Docker 1.11 or access to a Docker daemon. Installation $ sudo pip install ansible-container $ ansible-container version Build & Run $ git clone https://github.com/ansible/ansible-container-examples.git $ cd ansible-container-examples/ ; cp -r helloworld-nginx/ ansible $ ansible-container build $ ansible-container run –d $ ansible-container stop Push $ docker login $ ansible-container push
  • 21. Reference 21 Ansible Container https://github.com/ansible/ansible-container Documentation https://www.ansible.com/ansible-container ansible-container-examples https://github.com/ansible/ansible-container-examples 5 REASONS WE STARTED THE ANSIBLE CONTAINER PROJECT https://www.ansible.com/blog/ansible-container-project 6 WAYS ANSIBLE MAKES DOCKER-COMPOSE BETTER https://www.ansible.com/blog/six-ways-ansible-makes-docker-compose- better ANSIBLE AND CONTAINERS: WHY AND HOW https://www.ansible.com/blog/ansible-and-containers-why-and-how