「Docker 経由で Arch Linux をインストールする」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(英語版より新規作成)
 
8行目: 8行目:
 
Arch Linux は、最低 512 MiB の RAM を持つ [[Wikipedia:X86-64|x86_64]] 互換マシンで動作するはずですが、インストール用のライブシステムを起動するにはさらに多くのメモリが必要です [https://lists.archlinux.org/archives/list/arch-releng@lists.archlinux.org/message/D5HSGOFTPGYI6IZUEB3ZNAX4D3F3ID37/]。基本的なインストールは、ディスクスペース 2 GiB 未満で済むはずです。インストールプロセスはリモートリポジトリからパッケージを取得する必要があるため、このガイドでは動作するインターネット接続が利用可能であると仮定しています。さらに、ホスト上で動作する [[Docker]] のセットアップが必要です。技術的には、qemu がサポートする任意のホストを使用して Arch をインストールすることは確かに可能ですが、このガイドではその手法については取り扱いません。
 
Arch Linux は、最低 512 MiB の RAM を持つ [[Wikipedia:X86-64|x86_64]] 互換マシンで動作するはずですが、インストール用のライブシステムを起動するにはさらに多くのメモリが必要です [https://lists.archlinux.org/archives/list/arch-releng@lists.archlinux.org/message/D5HSGOFTPGYI6IZUEB3ZNAX4D3F3ID37/]。基本的なインストールは、ディスクスペース 2 GiB 未満で済むはずです。インストールプロセスはリモートリポジトリからパッケージを取得する必要があるため、このガイドでは動作するインターネット接続が利用可能であると仮定しています。さらに、ホスト上で動作する [[Docker]] のセットアップが必要です。技術的には、qemu がサポートする任意のホストを使用して Arch をインストールすることは確かに可能ですが、このガイドではその手法については取り扱いません。
   
== Pre-installation ==
+
== 事前準備 ==
   
  +
このガイドは、ホストシステムが通常期待される事項に関して既に事前設定されていることを前提としています。例えば、時間は正確に設定されている、インターネット接続は正常に動作している、必要な場合には EFI モードが正確に設定されている、などです。
This guide assumes that the host system is already pre-configured with regards to normally expected things. E.g. the time is setup correctly, internet connection is working normally, EFI mode if required is setup correctly etc.
 
   
  +
=== インストールメディアを準備する ===
=== Prepare an installation medium ===
 
   
  +
インストールには、Arch Linux がインストールされる対象ディレクトリが必要です。書き込み可能な任意のディレクトリを使用できますが、対象ディレクトリにはルートディスクとして機能するパーティションやボリュームがマウントされている可能性が高いです。
The installation requires a target directory to which Arch Linux will be installed. Any writable directory can be used, but it is quite likely that the target directory has a partition or volume mounted that will server as the root disk.
 
   
==== Full disk partitions ====
+
==== フルディスクパーティション ====
   
  +
フルディスクが対象として使用される場合、フォーマットする必要があるかもしれません。詳細は [[インストールガイド#パーティション]]を参照してください。そこでの同じパーティショニングの指示と順序がここでも適用できます。同じ制限と要件も適用されます。
If a full disk is being used as a target, it may need to be formatted. For details see [[Installation guide#Partition the disks]] as the same partitioning instructions and order can be followed from there. All the same restrictions and requirements as from there apply as well.
 
   
  +
同様に、新しいディスクもフォーマットする必要があります。[[インストールガイド#パーティションのフォーマット]]からの指示もこれに使用できます。
Likewise, the new disk will also needed to be formatted. The instructions from [[Installation guide#Format the partitions]] can be used for this as well.
 
   
==== Volumes ====
+
==== ボリューム ====
   
  +
[[btrfs]] や zfs などのファイルシステムを使用する場合、ファイルシステムのボリュームが使用できるオプションです。使用するファイルシステムによって、それらを作成するための独自のコマンドリストが使用されます。このガイドでは、btrfs を例として使用します。
When using filesystems such as [[btrfs]] or zfs, filesystem volumes are an option to use. Depending on what filesystem is used, creating them uses their own list of commands. In this guide, btrfs will be used as an example.
 
   
  +
まず、Arch Linux 用のルートボリュームが作成されます。このコマンドは、現在の作業ディレクトリが btrfs のルートボリューム(subvolid=5)であると仮定していますが、どこでも使用できます。異なる場所が使用される場合は、後で fstab などを定義する際にこれを考慮してください。また、Arch Linux 固有のボリュームがマウントされた(ルート)ボリューム上に作成されるため、下位のスタックが(フル)ディスク暗号化を使用している可能性があることに注意してください。
First, a root volume for Arch Linux is created. This command assumes the current working directory is the btrfs root volume (subvolid=5), but anywhere could be used. If a different location is used, within an existing hierarchy, keep this in mind when later defining fstab and similar. Also note, that as the Arch Linux specific volume is created on a mounted (root) volume, it could be the case that the underlying stack is using (full)disk encryption.
 
   
 
# btrfs subvolume create "arch_root"
 
# btrfs subvolume create "arch_root"
   
{{Note|To get the root volume, mount the btrfs with the {{ic|1=subvolid=5}} option.}}
+
{{Note|ルートボリュームを取得するには、btrfs {{ic|1=subvolid=5}} オプションでマウントします。}}
   
  +
=== ファイルシステムをマウントする ===
=== Mount the file systems ===
 
   
  +
以下のセクションは、Arch Linux が ''/tmp/target'' にインストールされる場所を前提としています。したがって、そのパーティションはそこにマウントされる必要があります。btrfs サブボリュームの名前が '''arch_root''' で、''autodefrag'' と ''LZO 圧縮'' が有効になっている場合、その設定は次のようになります:
The following section assumes the location Arch Linux will be installed into ''/tmp/target''. It is thus required that the partition is thus mounted there. Using a btrfs subvolume called '''arch_root''', with ''autodefrag'' and ''LZO compression'' enabled would look as:
 
   
 
# mkdir -p /tmp/target
 
# mkdir -p /tmp/target
 
# mount /dev/''disk'' /tmp/target -o subvol=arch_root,compress=lzo,autodefrag
 
# mount /dev/''disk'' /tmp/target -o subvol=arch_root,compress=lzo,autodefrag
   
  +
この作業にも [[インストールガイド#ファイルシステムのマウント]]からの指示が使用できます。
The instructions from [[Installation guide#Mount the file systems]] can be used for this as well.
 
   
 
== Installation ==
 
== Installation ==

2023年9月3日 (日) 20:14時点における版

このドキュメントは、公式の Docker Hub からの Arch Linux コンテナイメージを使用して Arch Linux をインストールするためのガイドです。代替手段によるインストールについては、Category:Arch の入手とインストールを参照してください。

インストールする前に、FAQ を参照することをお勧めします。このドキュメントで使用されている規則については、ヘルプ:読み方 を参照してください。特に、コード例には手動で置き換える必要があるプレースホルダー(イタリック体 でフォーマットされています)が含まれている場合があります。

より詳細な指示については、それぞれの ArchWiki の記事や、このガイドからリンクされている各プログラムの man ページ を参照してください。対話的なヘルプについては、IRC チャンネルフォーラム も利用可能です。

Arch Linux は、最低 512 MiB の RAM を持つ x86_64 互換マシンで動作するはずですが、インストール用のライブシステムを起動するにはさらに多くのメモリが必要です [1]。基本的なインストールは、ディスクスペース 2 GiB 未満で済むはずです。インストールプロセスはリモートリポジトリからパッケージを取得する必要があるため、このガイドでは動作するインターネット接続が利用可能であると仮定しています。さらに、ホスト上で動作する Docker のセットアップが必要です。技術的には、qemu がサポートする任意のホストを使用して Arch をインストールすることは確かに可能ですが、このガイドではその手法については取り扱いません。

事前準備

このガイドは、ホストシステムが通常期待される事項に関して既に事前設定されていることを前提としています。例えば、時間は正確に設定されている、インターネット接続は正常に動作している、必要な場合には EFI モードが正確に設定されている、などです。

インストールメディアを準備する

インストールには、Arch Linux がインストールされる対象ディレクトリが必要です。書き込み可能な任意のディレクトリを使用できますが、対象ディレクトリにはルートディスクとして機能するパーティションやボリュームがマウントされている可能性が高いです。

フルディスクパーティション

フルディスクが対象として使用される場合、フォーマットする必要があるかもしれません。詳細は インストールガイド#パーティションを参照してください。そこでの同じパーティショニングの指示と順序がここでも適用できます。同じ制限と要件も適用されます。

同様に、新しいディスクもフォーマットする必要があります。インストールガイド#パーティションのフォーマットからの指示もこれに使用できます。

ボリューム

btrfs や zfs などのファイルシステムを使用する場合、ファイルシステムのボリュームが使用できるオプションです。使用するファイルシステムによって、それらを作成するための独自のコマンドリストが使用されます。このガイドでは、btrfs を例として使用します。

まず、Arch Linux 用のルートボリュームが作成されます。このコマンドは、現在の作業ディレクトリが btrfs のルートボリューム(subvolid=5)であると仮定していますが、どこでも使用できます。異なる場所が使用される場合は、後で fstab などを定義する際にこれを考慮してください。また、Arch Linux 固有のボリュームがマウントされた(ルート)ボリューム上に作成されるため、下位のスタックが(フル)ディスク暗号化を使用している可能性があることに注意してください。

 # btrfs subvolume create "arch_root"
ノート: ルートボリュームを取得するには、btrfs を subvolid=5 オプションでマウントします。

ファイルシステムをマウントする

以下のセクションは、Arch Linux が /tmp/target にインストールされる場所を前提としています。したがって、そのパーティションはそこにマウントされる必要があります。btrfs サブボリュームの名前が arch_root で、autodefragLZO 圧縮 が有効になっている場合、その設定は次のようになります:

# mkdir -p /tmp/target
# mount /dev/disk /tmp/target -o subvol=arch_root,compress=lzo,autodefrag

この作業にも インストールガイド#ファイルシステムのマウントからの指示が使用できます。

Installation

Launching the container

The remainder of the installation will be done inside a docker container, abbreviated with ADC, Arch Docker Container.

 # docker run \
          --env PS1="ADC(\#)[\d \T:\w]\\$ " \
          --interactive \
          --privileged \
          --rm \
          --tty \
          --volume "/tmp/target:/target" \
          "index.docker.io/library/archlinux:latest" /bin/sh

Select the mirrors

Packages to be installed must be downloaded from mirror servers, which are defined in /etc/pacman.d/mirrorlist. In the docker container we first install reflector, which updates the mirror list by choosing 70 most recently synchronized HTTPS mirrors and sorting them by download rate. [2] First we have to install reflector in the docker container to be able to use it.

# reflector [--country <country>] \
             --latest 5 \
             --protocol http,https \
             --save "/etc/pacman.d/mirrorlist" \
             --sort rate

The higher a mirror is placed in the list, the more priority it is given when downloading a package. Ensure to inspect the file to see if it is satisfactory. If it is not, edit the file accordingly, and move the geographically closest mirrors to the top of the list, although other criteria should be taken into account.

This file will later be copied to the new system by pacstrap, so it is worth getting right.

Install essential packages

To be able to start the installation, the arch-install-scripts package must be installed into the Docker image first. Once completed, the official installation guide can be followed starting with the section Installation guide#Install essential packages.

Return to this guide before executing the Reboot step from the section Installation guide#Reboot to instead continue with the #Reboot below.

Reboot

Exit the docker container by typing exit or pressing Ctrl+d.

Optionally manually unmount all the partitions with umount -R "/target": this allows noticing any "busy" partitions, and finding the cause with fuser(1).

With a correctly setup boot loader, a reboot should now be possible into the freshly installed Arch Linux.

Post-installation

See General recommendations for system management directions and post-installation tutorials (like setting up a graphical user interface, sound or a touchpad).

For a list of applications that may be of interest, see List of applications.