Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Build Docker Images with Bazel
Search
micnncim
September 05, 2019
Programming
4
680
Build Docker Images with Bazel
Docker Meetup Tokyo #32
https://dockerjp.connpass.com/event/144717
micnncim
September 05, 2019
Tweet
Share
More Decks by micnncim
See All by micnncim
Spanner Autoscaler
micnncim
1
420
Accelerate Go development with Bazel
micnncim
9
6.9k
Protocol Buffers Language Server
micnncim
1
3k
How Uber "Go"es Recap
micnncim
2
2.3k
We want AWESOME CLI tool & development
micnncim
9
4.8k
GoReleaser: Release and Distribute Go Application
micnncim
9
990
Other Decks in Programming
See All in Programming
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
100
ログラスを支える設計標準について / loglass-design-standards
urmot
10
2.1k
SwiftUI Performance 不要なViewの再描画と更新を抑える
bigamitiongit
1
150
Doctrine ORMでValue Objectを扱う方法4選 #phpstudy / 4 ways to handle Value Objects with Doctrine ORM
77web
4
110
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
250
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.2k
Elm Form Validation
bkuhlmann
0
500
SpringBoot+MyBatisで例外が出たときどこを見るか
syukai
0
110
Ruby製社内ツールのGo移行
bgpat
2
330
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
Build with AI 2024 Seoul - 제로부터 시작하는 Flutter with Gemini 생활 - 박제창
itsmedreamwalker
0
200
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
210
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Practical Orchestrator
shlominoach
181
9.7k
Embracing the Ebb and Flow
colly
78
4.1k
The Power of CSS Pseudo Elements
geoffreycrofte
58
5k
Adopting Sorbet at Scale
ufuk
67
8.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
19
1.9k
The Pragmatic Product Professional
lauravandoore
24
5.8k
Writing Fast Ruby
sferik
619
60k
Learning to Love Humans: Emotional Interface Design
aarron
266
39k
KATA
mclloyd
14
12k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
115
18k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
Transcript
@micnncim Build Docker Images with Bazel Docker Meetup Tokyo #32
Presentation Outline Today's Agenda About Me How to build Docker
Image? What is Bazel? How good is Bazel for Docker? How to use Bazel for Docker? Recap
micnncim Twitter: @micnncim GitHub: @micnncim University Student / B4 Interest:
Go, Cloud Native, DevOps Favorite Base Image: distroless Blog: micnncim.github.io
Let's Build Docker Images EXPLORE THE WAYS TO BUILD DOCKER
IMAGES
How to build Docker Image? `docker image build` これまで Docker
Image をビルドすると いえば、これ BuildKit, kaniko, Buildah, ... " 次世代 Docker ビルドツール" は たくさんある 特に BuildKit の勢いがある Bazel 今⽇紹介するのはこれ
Bazel
What is Bazel? Fast 並列ビルドと キャッシュによる差分ビルドで速い リモートキャッシュにも対応 Correct ツールのバージョン固定や sandbox
化された環境でのビルドにより ワークスペースを汚染せず 再現性の⾼いビルドを⾏う Multi-language Docker に限らず 様々な⾔語・プラットフォームに対応 C++, Java, Python, Swift, Kotlin, Go, Rust, Scala, TypeScript, etc. Extensible Starlark という Python のサブセット⾔語で 拡張可能 WORKSPACE, BUILD(.bazel) といった ファイルを配置する
How good is Bazel for Docker? Develop with Docker +
Bazel
How good is Bazel for Docker? Docker Image Optimization デフォルトで
distoless を ベースイメージとし イメージサイズを ⾃動で最⼩化する ↓ テンプレート的な Dockerfile の数を 減らせる All in Bazel Build, Push, Pull に Docker を利⽤せず すべてが Bazel で 完結する
How to use Bazel for Docker? The usage for Bazel
+ Docker
bazelbuild/rules_docker HANDLE DOCKER Bazel ファイルに記述するだけで 利⽤可能 BUILD / PUSH /
PULL Bazel だけで Docker Image の Build, Push, Pull が出来る SUPPORT LANGUAGES go_image, py_image など 各⾔語⽤の `lang_image` が⽤意されている https://github.com/bazelbuild/rules_docker
Build with container_image
Build with go_image
Build with go_image
Pull with container_pull
Push with container_push
RECAP DOCKER IMAGE OPTIMIZATION ⾃動で最適化し、最⼩イメージを 作ってくれる ALL IN BAZEL エコシステムが
Bazel で完結する
See Also https://bazel.build http://github.com/ bazelbuild/bazel https://github.com/ bazelbuild/rules_docker
Twitter @micnncim Thank you! Presented by @micnncim GitHub @micnncim