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
750
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
490
Accelerate Go development with Bazel
micnncim
9
7.3k
Protocol Buffers Language Server
micnncim
1
3.1k
How Uber "Go"es Recap
micnncim
2
2.4k
We want AWESOME CLI tool & development
micnncim
9
5.2k
GoReleaser: Release and Distribute Go Application
micnncim
9
1.1k
Other Decks in Programming
See All in Programming
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
200
快速入門可觀測性
blueswen
0
330
Criando Commits Incríveis no Git
marcelgsantos
2
170
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
110
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
1
360
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
450
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
130
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
900
14 Years of iOS: Lessons and Key Points
seyfoyun
1
770
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
A Philosophy of Restraint
colly
203
16k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
Building an army of robots
kneath
302
44k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Practical Orchestrator
shlominoach
186
10k
What's in a price? How to price your products and services
michaelherold
243
12k
Six Lessons from altMBA
skipperchong
27
3.5k
Designing for Performance
lara
604
68k
Into the Great Unknown - MozCon
thekraken
33
1.5k
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