0
0

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.

Raspberry Pi 4 用に Docker Compose をビルドする

Last updated at Posted at 2021-03-13

Raspberry Pi 4 で動かしている Ubuntu Server 20.04.2 LTS の apt でインストールできる Docker Compose はバージョンが古いので、Raspberry Pi 4 用にビルドすることにしました。

前提

Docker がインストールされていること。

Raspberry Pi 4 上で以下の手順を実行する

  1. Docker Compose のプロジェクトをクローンする。

    $ git clone https://github.com/docker/compose.git
    
  2. ビルドしたいリリースのタグに切り替える。

    $ cd compose
    $ git checkout 1.28.5
    
  3. BuildKit を有効にして、make コマンドを実行する。

    $ DOCKER_BUILDKIT=1 make
    
  4. 10分程度待ちます。ビルドが終わると次のようなエラーメッセージが表示されますが問題ありません。

    + mv dist/docker-compose-linux-amd64 dist/docker-compose-Linux-aarch64
    mv: 'dist/docker-compose-linux-amd64'stat できません: そのようなファイルやディレクトリはありません
    

エラーメッセージが気になる場合は、script/build/linux を修正してください。

  1. 実行ファイルのバージョンを確認する。

    $ ./dist/docker-compose-linux-arm64 --version
    docker-compose version 1.28.5, build c4eb3a1f
    
  2. 実行ファイルをパスの通ったディレクトリーにコピー(もしくは移動)する。

    $ sudo mv ./dist/docker-compose-linux-arm64 /usr/bin/docker-compose
    

Docker Compose のビルドは Docker を使うように設定されているため、とても簡単にビルドすることができました。

以上です。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?