PHPerKaigi 2023 参加しました。

PHPerKaigi オフライン参加しました!!

よかったこと

ちょうぜつソフトウェア設計入門――PHPで理解するオブジェクト指向の活用 | 田中 ひさてる |本 | 通販 | Amazonが当たった!感謝!ちゃんと読みます。

反省

荷物選定があまかったと反省。個人用のラップトップPC持ってなかったので、PC不所持で参加するが手持ち無沙汰感があった。その場で何かしたい時はPCがないと何も出来ないと無力感を味わう。持ち運びが出来る軽いPCが欲しくなるな。

印象に残ったセッション

speakerdeck.com

Cacheについて学びが多かった。計測大事だし、データストアをどこに置くか、その置いた場所との距離は意識しないと効果が出ない。

PHP: Xhprof - Manual を教えてもらった。感謝

speakerdeck.com

PlantUMLは業務でよく使っている。設計ツールとしてはとても便利。知らない使い方が多々あったのでもう一度調べなおしておこう。

speakerdeck.com

PHPでRedisなんて作れないよと思ったけど作ってた。すごい。CodeCrafters は早速登録した。

あとでみる

speakerdeck.com お昼ご飯食べてたら見逃していた。

感想

熱量があってとても良かったし刺激を受けた!とてもすばらしいカンファレンスでした! 運営の皆様をはじめ、絡んでいただいた皆様、本当にありがとうございます!!

WSL に Elasticsearch 環境を整える

WSL 環境に Elasticsearch の環境を整えたくて試してみた。

www.elastic.co

こちらのサイトを試します。

1. Docker Image を 持ってくる

docker pull docker.elastic.co/elasticsearch/elasticsearch:8.6.1

2. Elasticsearch 用の docker network を作成

docker network create elastic

3. docker を実行

docker run --rm --name es01 --net elastic -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:8.6.1

起動失敗

bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log

他の方もどうようにElasitcsearch を起動するためのメモリが足りないので失敗する


対策として、実行時の vm.max_map_count の値を増やせばよいようだ

~ on 🅰  (tokyo)
❯ sudo sysctl -w vm.max_map_count=262144
vm.max_map_count = 262144

~ on 🅰  (tokyo)
❯ sudo  sysctl -a | grep 'vm.max_map_count'
vm.max_map_count = 262144

再実行すると成功する

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Elasticsearch security features have been automatically configured!
✅ Authentication is enabled and cluster connections are encrypted.

ℹ️  Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
*********************

ℹ️  HTTP CA certificate SHA-256 fingerprint:
*********************

ℹ️  Configure Kibana to use this cluster:
• Run Kibana and click the configuration link in the terminal when Kibana starts.
• Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
  *********************

ℹ️ Configure other nodes to join this cluster:
• Copy the following enrollment token and start new Elasticsearch nodes with `bin/elasticsearch --enrollment-token <token>` (valid for the next 30 minutes):
  *********************

  If you're running in Docker, copy the enrollment token and run:
  `docker run -e "ENROLLMENT_TOKEN=<token>" docker.elastic.co/elasticsearch/elasticsearch:8.6.1`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

4. 証明書を取得

docker cp es01:/usr/share/elasticsearch/config/certs/http_ca.crt .

5. アクセス

❯ curl --cacert http_ca.crt -u elastic https://localhost:9200
Enter host password for user 'elastic':
{
  "name" : "b324833a4784",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "vaUPvdtwS2iI5CQnWLkSBA",
  "version" : {
    "number" : "8.6.1",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "180c9830da956993e59e2cd70eb32b5e383ea42c",
    "build_date" : "2023-01-24T21:35:11.506992272Z",
    "build_snapshot" : false,
    "lucene_version" : "9.4.2",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

成功

6. まとめ

簡単に立ち上がるだろうと思ったらメモリ周りでうまくいかなかったのが残念だった。実運用時は、サーバーの設定は確認しないといけないですね。

Raspberry Pi に deno をインストール出来なかった

環境

pi@pi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
pi@pi:~ $ uname -a
Linux pi 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux

Deno は、arrch プロセッサのバイナリを提供していないので、ソースからビルドする

deno.land

1, Rust

cargo install deno --locked

~~~~
   Compiling zstd v0.11.2+zstd.1.5.2
   Compiling deno v1.29.2
The following warnings were emitted during compilation:

warning: Compiling with all symbols exported, this will result in a larger binary. Please use glibc 2.35 or later for an optimised build.

error: could not compile `deno`

Caused by:
  process didn't exit successfully: `rustc --crate-name deno --edition=2021 /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/deno-1.29.2/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=c57775ea426afea5 -C extra-filename=-c57775ea426afea5 --out-dir /tmp/cargo-installF3SKCi/release/deps -L dependency=/tmp/cargo-installF3SKCi/release/deps --extern atty=/tmp/cargo-installF3SKCi/release/deps/libatty-bb74996eed0bc80c.rlib --extern base32=/tmp/cargo-installF3SKCi/release/deps/libbase32-b8f9271e5d6f2bb5.rlib --extern base64=/tmp/cargo-installF3SKCi/release/deps/libbase64-3bd0d108169fc6a9.rlib --extern cache_control=/tmp/cargo-installF3SKCi/release/deps/libcache_control-c27caac829f636f3.rlib --extern chrono=/tmp/cargo-installF3SKCi/release/deps/libchrono-6c67233832506a07.rlib --extern clap=/tmp/cargo-installF3SKCi/release/deps/libclap-5535459cb42d5295.rlib --extern clap_complete=/tmp/cargo-installF3SKCi/release/deps/libclap_complete-15a9682b22c52194.rlib --extern clap_complete_fig=/tmp/cargo-installF3SKCi/release/deps/libclap_complete_fig-ee710cce3bc5739c.rlib --extern console_static_text=/tmp/cargo-installF3SKCi/release/deps/libconsole_static_text-3d37d66b6aafdb1c.rlib --extern data_url=/tmp/cargo-installF3SKCi/release/deps/libdata_url-9b0c8571d53bf18b.rlib --extern deno_ast=/tmp/cargo-installF3SKCi/release/deps/libdeno_ast-a4eef8a5b2b15beb.rlib --extern deno_core=/tmp/cargo-installF3SKCi/release/deps/libdeno_core-7ac5f39426c89a5d.rlib --extern deno_doc=/tmp/cargo-installF3SKCi/release/deps/libdeno_doc-86a8bb636119c7cb.rlib --extern deno_emit=/tmp/cargo-installF3SKCi/release/deps/libdeno_emit-a1b9ff61abc3a1b7.rlib --extern deno_graph=/tmp/cargo-installF3SKCi/release/deps/libdeno_graph-8cfabe6293d931d9.rlib --extern deno_lint=/tmp/cargo-installF3SKCi/release/deps/libdeno_lint-c8682be57fcbf618.rlib --extern deno_runtime=/tmp/cargo-installF3SKCi/release/deps/libdeno_runtime-4c2627d93f9995f9.rlib --extern deno_task_shell=/tmp/cargo-installF3SKCi/release/deps/libdeno_task_shell-9be8b04756c323be.rlib --extern dissimilar=/tmp/cargo-installF3SKCi/release/deps/libdissimilar-074b5ef7e77e54f4.rlib --extern dprint_plugin_json=/tmp/cargo-installF3SKCi/release/deps/libdprint_plugin_json-ad8617e4b3aeb379.rlib --extern dprint_plugin_markdown=/tmp/cargo-installF3SKCi/release/deps/libdprint_plugin_markdown-977f1de0cb2629c3.rlib --extern dprint_plugin_typescript=/tmp/cargo-installF3SKCi/release/deps/libdprint_plugin_typescript-a57a9c2813adb6f4.rlib --extern encoding_rs=/tmp/cargo-installF3SKCi/release/deps/libencoding_rs-4c2f54050a9bef9c.rlib --extern env_logger=/tmp/cargo-installF3SKCi/release/deps/libenv_logger-b6cdf4d40979c767.rlib --extern eszip=/tmp/cargo-installF3SKCi/release/deps/libeszip-6206085651b6c061.rlib --extern fancy_regex=/tmp/cargo-installF3SKCi/release/deps/libfancy_regex-c5bed447b7bf0e29.rlib --extern flate2=/tmp/cargo-installF3SKCi/release/deps/libflate2-90b13e3c6d355cd1.rlib --extern http=/tmp/cargo-installF3SKCi/release/deps/libhttp-548628cb5393d030.rlib --extern import_map=/tmp/cargo-installF3SKCi/release/deps/libimport_map-559941be70cda84f.rlib --extern indexmap=/tmp/cargo-installF3SKCi/release/deps/libindexmap-a6dc4557ca6b7135.rlib --extern jsonc_parser=/tmp/cargo-installF3SKCi/release/deps/libjsonc_parser-f823772e6ce8e4b8.rlib --extern libc=/tmp/cargo-installF3SKCi/release/deps/liblibc-87497658c8d1425c.rlib --extern log=/tmp/cargo-installF3SKCi/release/deps/liblog-397e7166c6e9716f.rlib --extern lsp_types=/tmp/cargo-installF3SKCi/release/deps/liblsp_types-35feb1f18bf9ba0e.rlib --extern lzzzz=/tmp/cargo-installF3SKCi/release/deps/liblzzzz-5a605d51ab110a99.rlib --extern mitata=/tmp/cargo-installF3SKCi/release/deps/libmitata-416f9d94b04c01fb.rlib --extern monch=/tmp/cargo-installF3SKCi/release/deps/libmonch-3c9c8d0b7a833dba.rlib --extern napi_sym=/tmp/cargo-installF3SKCi/release/deps/libnapi_sym-ef29a63d09c466a9.so --extern nix=/tmp/cargo-installF3SKCi/release/deps/libnix-21578c108535421d.rlib --extern notify=/tmp/cargo-installF3SKCi/release/deps/libnotify-fb2827ebc245d3b4.rlib --extern once_cell=/tmp/cargo-installF3SKCi/release/deps/libonce_cell-4bdf7a7dbfb0d3af.rlib --extern os_pipe=/tmp/cargo-installF3SKCi/release/deps/libos_pipe-ac05d8e8952b9020.rlib --extern percent_encoding=/tmp/cargo-installF3SKCi/release/deps/libpercent_encoding-40a13abe5af30a9e.rlib --extern pin_project=/tmp/cargo-installF3SKCi/release/deps/libpin_project-289e48e334843b78.rlib --extern rand=/tmp/cargo-installF3SKCi/release/deps/librand-d8821a0c7d32656e.rlib --extern regex=/tmp/cargo-installF3SKCi/release/deps/libregex-f790657814a6dfb2.rlib --extern ring=/tmp/cargo-installF3SKCi/release/deps/libring-5e0e060234b47b13.rlib --extern rustyline=/tmp/cargo-installF3SKCi/release/deps/librustyline-bb868cac757daaa9.rlib --extern rustyline_derive=/tmp/cargo-installF3SKCi/release/deps/librustyline_derive-d7717e3254753fd5.so --extern semver=/tmp/cargo-installF3SKCi/release/deps/libsemver-2fed88a39fffc1a4.rlib --extern serde=/tmp/cargo-installF3SKCi/release/deps/libserde-8c77fc8ed83d51f1.rlib --extern serde_repr=/tmp/cargo-installF3SKCi/release/deps/libserde_repr-10dac363acd009f0.so --extern shell_escape=/tmp/cargo-installF3SKCi/release/deps/libshell_escape-cce122bf954536a8.rlib --extern tar=/tmp/cargo-installF3SKCi/release/deps/libtar-e25397413bf08077.rlib --extern secure_tempfile=/tmp/cargo-installF3SKCi/release/deps/libtempfile-cb6c48ce1f0fc76b.rlib --extern text_size=/tmp/cargo-installF3SKCi/release/deps/libtext_size-206cf2a4dd379e0d.rlib --extern text_lines=/tmp/cargo-installF3SKCi/release/deps/libtext_lines-7fd0b0e9fdb2e6fd.rlib --extern tokio=/tmp/cargo-installF3SKCi/release/deps/libtokio-d89d099f03c76e88.rlib --extern tokio_util=/tmp/cargo-installF3SKCi/release/deps/libtokio_util-29d13bdadfb22697.rlib --extern tower_lsp=/tmp/cargo-installF3SKCi/release/deps/libtower_lsp-cd7b5e7c88885d16.rlib --extern twox_hash=/tmp/cargo-installF3SKCi/release/deps/libtwox_hash-13a0ae807e673197.rlib --extern typed_arena=/tmp/cargo-installF3SKCi/release/deps/libtyped_arena-213d389c86b3fc6c.rlib --extern uuid=/tmp/cargo-installF3SKCi/release/deps/libuuid-c8efef8ea932e23a.rlib --extern walkdir=/tmp/cargo-installF3SKCi/release/deps/libwalkdir-6787b1bfed41038d.rlib --extern zstd=/tmp/cargo-installF3SKCi/release/deps/libzstd-3a32007e13ddaf41.rlib --cap-lints allow -C link-arg=-rdynamic -L /tmp/cargo-installF3SKCi/release/gn_out/obj -L native=/tmp/cargo-installF3SKCi/release/build/libsqlite3-sys-ea0f85390161e1ea/out -L native=/tmp/cargo-installF3SKCi/release/build/ring-9238fa2ae41a9d52/out -L /tmp/cargo-installF3SKCi/release/build/libffi-sys-c1f76a09561f5818/out/libffi-root/lib -L /tmp/cargo-installF3SKCi/release/build/libffi-sys-c1f76a09561f5818/out/libffi-root/lib64 -L native=/tmp/cargo-installF3SKCi/release/build/lzzzz-e9fad1b2266e2084/out -L native=/tmp/cargo-installF3SKCi/release/build/zstd-sys-f7d7363a6f2e0127/out` (signal: 9, SIGKILL: kill)
error: failed to compile `deno v1.29.2`, intermediate artifacts can be found at `/tmp/cargo-installF3SKCi`

最後の Compile で失敗

Please use glibc 2.35 or later for an optimised build.

glibc 2.35 が必要

pi@pi:~ $ ldd --version
ldd (Debian GLIBC 2.31-13+rpt2+rpi1+deb11u4) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

インストールされているバージョンは、 2.31

バージョンアップが必要

Raspberry Pi のパッケージを更新してみる

sudo apt update
sudo apt upgrade
pi@pi:~ $ ldd --version
ldd (Debian GLIBC 2.31-13+rpt2+rpi1+deb11u5) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

変わらなかった。

Debian 11 bullseye の glibc は 2.31 のようだ。

packages.debian.org

Debian のバージョンをあげるしかないのかな。

Raspberry Pi に Rust をインストール

環境

pi@pi:~/package $ uname -a
Linux pi 5.15.61-v7l+ #1579 SMP Fri Aug 26 11:13:03 BST 2022 armv7l GNU/Linux
pi@pi:~/package $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

1. Rust Install

pi@pi:~/package $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  /home/pi/.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:

  /home/pi/.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

  /home/pi/.cargo/bin

This path will then be added to your PATH environment variable by
modifying the profile files located at:

  /home/pi/.profile
  /home/pi/.bashrc

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: armv7-unknown-linux-gnueabihf
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1

info: profile set to 'default'
info: default host triple is armv7-unknown-linux-gnueabihf
info: syncing channel updates for 'stable-armv7-unknown-linux-gnueabihf'
info: latest update on 2022-12-15, rust version 1.66.0 (69f9c33d7 2022-12-12)
info: downloading component 'cargo'
  6.1 MiB /   6.1 MiB (100 %)   4.9 MiB/s in  2s ETA:  0s
info: downloading component 'clippy'
info: downloading component 'rust-docs'
 19.0 MiB /  19.0 MiB (100 %)  10.1 MiB/s in  2s ETA:  0s
info: downloading component 'rust-std'
 26.9 MiB /  26.9 MiB (100 %)   8.6 MiB/s in  4s ETA:  0s
info: downloading component 'rustc'
 80.4 MiB /  80.4 MiB (100 %)   9.8 MiB/s in  9s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
  6.1 MiB /   6.1 MiB (100 %)   5.0 MiB/s in  1s ETA:  0s
info: installing component 'clippy'
info: installing component 'rust-docs'
 19.0 MiB /  19.0 MiB (100 %)   1.8 MiB/s in 20s ETA:  0s
info: installing component 'rust-std'
 26.9 MiB /  26.9 MiB (100 %)   4.4 MiB/s in 11s ETA:  0s
info: installing component 'rustc'
 80.4 MiB /  80.4 MiB (100 %)   4.6 MiB/s in 18s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-armv7-unknown-linux-gnueabihf'

  stable-armv7-unknown-linux-gnueabihf installed - rustc 1.66.0 (69f9c33d7 2022-12-12)


Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, run:
source "$HOME/.cargo/env"

Raspberry Pi に docker をインストールする

環境

pi@pi:~/package $ uname -a
Linux pi 5.15.61-v7l+ #1579 SMP Fri Aug 26 11:13:03 BST 2022 armv7l GNU/Linux
pi@pi:~/package $ cat /etc/issue
Raspbian GNU/Linux 11 \n \l
pi@pi:~/package $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

docs.docker.com

こちらを実行する

1 cleanup

pi@pi:~/package $ sudo apt-get remove docker docker-engine docker.io containerd runc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package docker-engine

2. package install

pi@pi:~/package $ sudo apt-get update
sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
Get:1 http://archive.raspberrypi.org/debian bullseye InRelease [23.6 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease [15.0 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages [13.2 MB]
Get:4 http://archive.raspberrypi.org/debian bullseye/main armhf Packages [311 kB]
Fetched 13.6 MB in 11s (1,187 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ca-certificates is already the newest version (20210119).
curl is already the newest version (7.74.0-1.3+deb11u3).
gnupg is already the newest version (2.2.27-2+deb11u2).
lsb-release is already the newest version (11.1.0+rpi1).
lsb-release set to manually installed.
The following package was automatically installed and is no longer required:
  libfuse2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 110 not upgraded.

3. Add GPG Key, set up the repository

pi@pi:~/package $ sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
pi@pi:~/package $ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
pi@pi:~/package $ sudo apt-get update
Get:1 https://download.docker.com/linux/debian bullseye InRelease [43.3 kB]
Get:2 https://download.docker.com/linux/debian bullseye/stable armhf Packages [15.3 kB]
Hit:3 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:4 http://archive.raspberrypi.org/debian bullseye InRelease
Fetched 58.6 kB in 7s (8,791 B/s)
Reading package lists... Done

4. docker install

pi@pi:~/package $ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfuse2
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  apparmor docker-ce-rootless-extras libslirp0 slirp4netns
Suggested packages:
  apparmor-profiles-extra apparmor-utils cgroupfs-mount | cgroup-lite
The following NEW packages will be installed:
  apparmor containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin libslirp0 slirp4netns
0 upgraded, 8 newly installed, 0 to remove and 110 not upgraded.
Need to get 87.2 MB of archives.
After this operation, 353 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://download.docker.com/linux/debian bullseye/stable armhf containerd.io armhf 1.6.14-1 [20.4 MB]
Get:2 http://ftp.udx.icscoe.jp/Linux/raspbian/raspbian bullseye/main armhf apparmor armhf 2.13.6-10 [532 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libslirp0 armhf 4.4.0-1+deb11u2 [50.2 kB]
Get:4 https://download.docker.com/linux/debian bullseye/stable armhf docker-ce-cli armhf 5:20.10.22~3-0~debian-bullseye [37.5 MB]
Get:5 http://ftp.udx.icscoe.jp/Linux/raspbian/raspbian bullseye/main armhf slirp4netns armhf 1.0.1-2 [29.0 kB]
Get:6 https://download.docker.com/linux/debian bullseye/stable armhf docker-ce armhf 5:20.10.22~3-0~debian-bullseye [13.1 MB]
Get:7 https://download.docker.com/linux/debian bullseye/stable armhf docker-ce-rootless-extras armhf 5:20.10.22~3-0~debian-bullseye [7,442 kB]
Get:8 https://download.docker.com/linux/debian bullseye/stable armhf docker-compose-plugin armhf 2.14.1~debian-bullseye [8,218 kB]
Fetched 87.2 MB in 8s (11.4 MB/s)
Preconfiguring packages ...
Selecting previously unselected package apparmor.
(Reading database ... 108020 files and directories currently installed.)
Preparing to unpack .../0-apparmor_2.13.6-10_armhf.deb ...
Unpacking apparmor (2.13.6-10) ...
Selecting previously unselected package containerd.io.
Preparing to unpack .../1-containerd.io_1.6.14-1_armhf.deb ...
Unpacking containerd.io (1.6.14-1) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../2-docker-ce-cli_5%3a20.10.22~3-0~debian-bullseye_armhf.deb ...
Unpacking docker-ce-cli (5:20.10.22~3-0~debian-bullseye) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../3-docker-ce_5%3a20.10.22~3-0~debian-bullseye_armhf.deb ...
Unpacking docker-ce (5:20.10.22~3-0~debian-bullseye) ...
Selecting previously unselected package docker-ce-rootless-extras.
Preparing to unpack .../4-docker-ce-rootless-extras_5%3a20.10.22~3-0~debian-bullseye_armhf.deb ...
Unpacking docker-ce-rootless-extras (5:20.10.22~3-0~debian-bullseye) ...
Selecting previously unselected package docker-compose-plugin.
Preparing to unpack .../5-docker-compose-plugin_2.14.1~debian-bullseye_armhf.deb ...
Unpacking docker-compose-plugin (2.14.1~debian-bullseye) ...
Selecting previously unselected package libslirp0:armhf.
Preparing to unpack .../6-libslirp0_4.4.0-1+deb11u2_armhf.deb ...
Unpacking libslirp0:armhf (4.4.0-1+deb11u2) ...
Selecting previously unselected package slirp4netns.
Preparing to unpack .../7-slirp4netns_1.0.1-2_armhf.deb ...
Unpacking slirp4netns (1.0.1-2) ...
Setting up apparmor (2.13.6-10) ...
Created symlink /etc/systemd/system/sysinit.target.wants/apparmor.service → /lib/systemd/system/apparmor.service.
Setting up containerd.io (1.6.14-1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /lib/systemd/system/containerd.service.
Setting up docker-compose-plugin (2.14.1~debian-bullseye) ...
Setting up docker-ce-cli (5:20.10.22~3-0~debian-bullseye) ...
Setting up libslirp0:armhf (4.4.0-1+deb11u2) ...
Setting up docker-ce-rootless-extras (5:20.10.22~3-0~debian-bullseye) ...
Setting up slirp4netns (1.0.1-2) ...
Setting up docker-ce (5:20.10.22~3-0~debian-bullseye) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u4) ...

5. run hello world

pi@pi:~/package $ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
04341b189be6: Pull complete
Digest: sha256:94ebc7edf3401f299cd3376a1669bc0a49aef92d6d2669005f9bc5ef028dc333
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (arm32v7)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

インストール完了

情報セキュリティ 自分メモ

自分用メモ

情報セキュリティ(CIA)について

ほぼWikiの写し

CIAとは、

  • Confidentiality (機密性 )
  • Integrity (完全性)
  • Avalability (可用性)

の頭文字をつなげた言葉

また、4つの拡張定義もある

  • Authenticity (真正性)
  • Accountability (責任追跡性)
  • Non-repudiation (否認防止)
  • Reliability (信頼性)

機密性

機密性とは、情報へのアクセスを認められた者だけがアクセス出来る状態 暗号技術、アクセス制御

完全性

情報が改ざんまたは、消去されてない状態

認証技術、電子署名

可用性

必要な時に必要な情報にアクセスが可能であるか

ファイヤーウォール‘、冗長構成

ISMS

Information Security Management Systemの略で、情報セキュリティマネージメントシステムのこと。

これは、情報セキュリティ(CIA)を守るための仕組みです。

f:id:yoshioka627:20210104235102p:plain
出典: ISMS適合性評価制度

CIAは、ISO/IEC 27001 (JIS Q 27001) にも掲載されてます。

参考

ja.wikipedia.org

www.kikakurui.com

https://isms.jp/doc/JIP-ISMS120-62.pdf

Raspberry Pi 4 Model B にUbuntu Core をインストール

Raspberry PI にUbuntuCoreを入れてみた。

ubuntu.com

Build secure IoT devices with Ubuntu Core

UbuntuCoreで安全なIoTデバイスを構築する

Raspberry Pi Imager インストール

インストールは、Raspberry Pi Imager を使う

www.raspberrypi.org

f:id:yoshioka627:20201224193114p:plain
起動画面

SD カードの初期化

ラズパイで利用しているSDカードを初期化します

Operating System にある Erase 選択

f:id:yoshioka627:20201224193308p:plain
SDカードの初期化

SD カードを選択して実行(Write)

f:id:yoshioka627:20201224193239p:plain
SDカードの初期化

初期化完了

Ubuntu Core をSDカードに書き込む

OS をUbuntuCoreにする

f:id:yoshioka627:20201224193751p:plain
Other general pupose OS を選択

f:id:yoshioka627:20201224193831p:plain
Ubuntu を選択

f:id:yoshioka627:20201224193852p:plain
Ubuntu Coreを選択

Device を選択

f:id:yoshioka627:20201224194124p:plain

f:id:yoshioka627:20201224194159p:plain
選択完了

実行すると、UbuntuCoreが入っているSDカードが出来る

f:id:yoshioka627:20201224200746p:plain
書き込み中

f:id:yoshioka627:20201224200850p:plain
書き込み完了

RaspberryPiを起動

UbuntuCoreを入れたSDカードを使ってラズパイを起動させる

f:id:yoshioka627:20201224201541j:plain
起動開始

f:id:yoshioka627:20201224195914j:plain
ネットワーク選択画面

f:id:yoshioka627:20201224200142j:plain
WiFi選択が出来る

f:id:yoshioka627:20201224201715j:plain
profile setup

Ubuntu アカウントを持っていなかったら作成する

f:id:yoshioka627:20201224202043j:plain
完了

リモートからログインが出来る

f:id:yoshioka627:20201224202633p:plain
ログイン

Ubuntu アカウント作成

アカウント作成はこちらから

ubuntu.com

ログインするにはUbuntuのアカウントと鍵の登録が必要です。

ここで生成した鍵を使ってログインします。

まとめ

Software version
Raspberry Pi Imager v1.5
Ubuntu Core 18 (GNU/Linux 5.3.0-1036-raspi2 aarch64)