1
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?

Ubuntu22.04にcolimaをインストールする

Posted at

Dockerを動かす手段の1つとして、colimaがあります。colimaをmacOSで動かす手順は広く知られていますが、Ubuntu22.04で動かす方法があまり広まっていないので、この度、Qiita記事にまとめてみました。

手順

  1. Ubuntu22.04にNixをインストールする
  2. Nixでcolimaをインストールする
  3. Docker ComposeとBuildxをプラグインとして導入する

順に見ていきましょう。

1. Ubuntu22.04にNixをインストールする

下記のDeterminate Nix Installerを使用します。

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

途中でsudo権限を求められます。また、設問に答える必要があります(YでOK)。

メッセージで表示されますが、最後に下記を実行します。

. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh

2. Nixでcolimaをインストールする

下記の手順は古いです。

代わりに下記のコマンドを使います。

nix profile install nixpkgs#colima

3. Docker ComposeとBuildxをプラグインとして導入する

基本的には下記に沿って、都度、最新版の手順を実行していきます。

Docker Composeをインストールする

最後に .bashrc に下記を足します。

.bashrc
export DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}

Buildxをインストールする

下記から最新版のURLを取得します。

下記のようにコマンドを入力します(プラットフォームは linux-amd64 としています)。

curl -SL https://github.com/docker/buildx/releases/download/v0.21.2/buildx-v0.21.2.linux-amd64 -o $DOCKER_CONFIG/cli-plugins/docker-buildx
chmod +x $DOCKER_CONFIG/cli-plugins/docker-buildx
docker buildx version

バージョンが表示されればbuildxの導入は完了です。

その後、次のコマンドを実行して、buildxをデフォルトにします。

docker buildx install
1
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
1
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?