LoginSignup
0
1

LXD で Alpine を使う

Last updated at Posted at 2020-10-09

Ubuntu 23.04 にインストールされた lxd 5.14 に Alpine をインストールし設定する方法です。
インストールが完了してログインすると次のようになります。

$ ssh alpine.local
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <https://wiki.alpinelinux.org/>.

You can setup the system with the command: setup-alpine

You may change this message by editing /etc/motd.

alpine:~$ uname -a
Linux alpine 5.15.0-50-generic #56-Ubuntu SMP Tue Sep 20 13:23:26 UTC 2022 x86_64 Linux
alpine:~$ cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.16.2
PRETTY_NAME="Alpine Linux v3.16"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

OS のインストール

lxc launch images:alpine/edge alpine

root のパスワードを設定

lxc exec alpine -- passwd

login

$ lxc console alpine
To detach from the console, press: <ctrl>+a q

Welcome to Alpine Linux 3.18
Kernel 6.2.0-20-generic on an x86_64 (/dev/console)

alpine login:

login 後のインストールと設定

ユーザーの作成

adduser -u 1200 uchida

sudo

apk add sudo
addgroup uchida wheel
/etc/sudoers.d/wheel
%wheel ALL=(ALL) ALL

sshd のインストール

sudo apk add openssh
sudo service sshd restart
sudo rc-update add sshd

avahi のインストール

sudo apk add avahi
sudo apk add dbus
sudo rc-update add dbus
sudo rc-update add avahi-daemon
sudo service avahi-daemon restart

avahi が動けば、次のようにしてログインが出来ます。

ssh alpine.local

追加情報

nginx のインストール

sudo apk add nginx

起動

sudo service nginx start

python のインストール

sudo apk add python3
0
1
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
1