7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

DockerコンテナをマルチCPUアーキテクチャ対応でビルドする方法

Posted at

準備

dockerのbuildxを使ってビルドします。まずはビルダを作成して起動します。

docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx inspect --bootstrap

ビルド・push

ビルドしてpushします。--platformにはビルドしたいプラットフォームを指定します。ここではarm64とamd64を指定しています。

docker buildx build \
  --platform linux/arm64,linux/amd64 \
  -t {ご所望のDockerHubレジストリ(user_name/registry_name)} \
  --push .
7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?