Adachinですっ。
2013年から始まった自宅サーバ(実家)。
最初のブログとか見ると3年前の自分は非常に知識不足だったと改めて感じましたw(恥ずかしいレベル)2015年から仮想コンテナ技術(docker)が発表され、インフラ構築方法も変わり始めました。新時代の幕開けとしてインフラコンテナ技術を勉強しないとまずい!!2016年AWSでlambdaが発表されサーバレスも流行りだし、どんどん新技術には手を出さないとまずい!!
今回は新たなるチャレンジとして、大学時代に作った自作サーバ(windows/いろいろカスタマイズ)をDockerサーバに転用したいなと今年の3月くらいに感じ、2016/10/14金曜日に友人(くにしー)と構築したのでブログにまとめます。用途としては問題なくサービスが運営できるか、検証機器としてです。
下記の画像では左上が現Adachin-Server-Lab(ブログ)が動いており、右上が今回dockerサーバとなります。後ほどスペックなど紹介していきます。
■雑な自宅ネットワーク構成図(実家)
基本ルーターでポートを開放してあげてます。セキュリティとしてdockerサーバには外部からログインできないよう、adachin-serverを踏み台としてsshできるようにしました。ここらへんはラズベリーパイをかましたいところ。
■dockerサーバスペック
・Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz/
仮想コア数も含めて8個
・メモリー10GB
・HDD 1TB
■CoreOSのインストール
CoreOSはdockerに特化されてて、デフォルトでdockerパッケージ系はすべてインストールされています。CentOS7もサポートされてますが、せっかくなのでCoreOSでやりました。
https://coreos.com/os/docs/latest/booting-with-iso.html
とりあえずCoreOS自体容量少ない(136MB)ので、USBからマウントしてインストールしよう!となりました。BIOSからUSBを優先度1にして起動してみたが、うまくいかなかった。。ちなみにUSBではこんな作業をしてました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
Adachin-Air-11 > df -h Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk1 112Gi 86Gi 25Gi 78% 1868211 4293099068 0% / devfs 191Ki 191Ki 0Bi 100% 660 0 100% /dev map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home /dev/disk3s1 29Gi 4.2Gi 25Gi 15% 137433 818199 14% /Volumes/VIRUS-USB Adachin-Air-11 > diskutil unmountDisk /dev/disk3s1 Unmount of all volumes on disk3 was successful [~/Desktop] Adachin-Air-11 > df -h Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk1 112Gi 86Gi 25Gi 78% 1868226 4293099053 0% / devfs 191Ki 191Ki 0Bi 100% 660 0 100% /dev map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home [~/Desktop] Adachin-Air-11 > sudo dd if=/Users/adachin/Desktop/coreos_production_iso_image.iso of= /dev/disk3s1 bs=1m 256+0 records in 256+0 records out 268435456 bytes transferred in 122.074793 secs (2198943 bytes/sec) [~/Desktop] |
Diskに焼くしかないな、しかし余ったDiskもないじゃねえか!!と悩んだ挙句、公式にはこんなことを書いてありました。
https://coreos.com/os/docs/latest/installing-to-disk.html
The script is self-contained and located on GitHub here and can be run from any Linux distribution.
You cannot normally install CoreOS to the same device that is currently booted.
However, the CoreOS ISO or any Linux liveCD will allow CoreOS to install to a non-active device.
訳)
スクリプトはGitHub上にあり、
すべてのLinuxディストリビューションから実行することができます。
通常は現在ブートされているのと同じデバイスにCoreOSをインストールすることはできません。
しかしCoreOS ISOまたは任意のLinuxのLiveCDはCoreOSが非アクティブデバイスにインストールすることができます。
つまり、Linux上からスクリプトを叩いてインストールできる!!!というわけでくにしーが持参してたUSBの中にTails Linuxがあったので、こいつから以下のスクリプトを叩いてみました。
しかし、Tails Linuxとか半端ないセキュアLinuxで、自分が操作したログなど全部残さず抹消してしまいます。これはぱないのであとでUSBにインストールしてみよう。
・coreos-install.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
#!/bin/bash # Copyright (c) 2013 The CoreOS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. set -e -o pipefail error_output() { echo "Error: return code $? from $BASH_COMMAND" >&2 } # Ensure that required executables exist before proceeding which wget >/dev/null || { echo 'Missing wget!' >&2 ; exit 1 ; } which gpg >/dev/null || { echo 'Missing gpg!' >&2 ; exit 1 ; } # Everything we do should be user-access only! umask 077 if grep -q "^ID=coreos$" /etc/os-release; then source /etc/os-release [[ -f /usr/share/coreos/update.conf ]] && source /usr/share/coreos/update.conf [[ -f /etc/coreos/update.conf ]] && source /etc/coreos/update.conf fi # Fall back on the current stable if os-release isn't useful : ${VERSION_ID:=current} CHANNEL_ID=${GROUP:-stable} OEM_ID= if [[ -e /etc/oem-release ]]; then # Pull in OEM information too, but prefixing variables with OEM_ eval "$(sed -e 's/^/OEM_/' /etc/oem-release)" fi USAGE="Usage: $0 [-V version] [-d /dev/device] Options: -d DEVICE Install CoreOS to the given device. -V VERSION Version to install (e.g. current) [default: ${VERSION_ID}] -C CHANNEL Release channel to use (e.g. beta) [default: ${CHANNEL_ID}] -o OEM OEM type to install (e.g. ami) [default: ${OEM_ID:-(none)}] -c CLOUD Insert a cloud-init config to be executed on boot. -i IGNITION Insert an Ignition config to be executed on boot. -t TMPDIR Temporary location with enough space to download images. -v Super verbose, for debugging. -b BASEURL URL to the image mirror -n Copy generated network units to the root partition. -h This ;-) This tool installs CoreOS on a block device. If you PXE booted CoreOS on a machine then use this tool to make a permanent install. " # Image signing key: # pub 4096R/93D2DCB4 2013-09-06 # uid [ unknown] CoreOS Buildbot (Offical Builds) <buildbot@coreos.com> # sub 4096R/74E7E361 2013-09-06 [expired: 2014-09-06] # sub 4096R/E5676EFC 2014-09-08 [expired: 2015-09-08] # sub 4096R/1CB5FA26 2015-08-31 [expires: 2017-08-30] # sub 4096R/B58844F1 2015-11-20 [revoked: 2016-05-16] # sub 4096R/2E16137F 2016-05-16 [expires: 2017-05-16] GPG_LONG_ID="50E0885593D2DCB4" GPG_KEY="-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2 mQINBFIqVhQBEADjC7oxg5N9Xqmqqrac70EHITgjEXZfGm7Q50fuQlqDoeNWY+sN szpw//dWz8lxvPAqUlTSeR+dl7nwdpG2yJSBY6pXnXFF9sdHoFAUI0uy1Pp6VU9b /9uMzZo+BBaIfojwHCa91JcX3FwLly5sPmNAjgiTeYoFmeb7vmV9ZMjoda1B8k4e 8E0o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LXtDiz/eG/1rIdxkO h3D61WiyD/42Oj2h4BHt5qTS12By95po4avzgqaV3PFYi9Rx6tBvzwnD7x2UeGk4 wzFdb2V4LWoe6bqMokxbUMWJgP5faWDT6/urhBt4GYcBxX0b3l9qBs20hP5JVHGX 208gOW5cjfHrTNiHiY4/CbQrbAdO24CUYZtYEmDNdHN+KHrlLLjkf0v5yGjVK2XB qs8l6upA7xBGHAF7U/XkLYrvyusqqWdvdGHGHthbLBzjceO+4N+lb6RyHRuF6kgb LdCcaKfCMUs/v1ZXgYGhdk7NWFHFDoF8DByHwluoihd10OudGPFg7ydTc6+V3kt9 SN1/iQbk2/rHffI1tm28MfBvN+K/Da+Y+EAqTbUDHl6O30mSGZjLl1xJxvWoezU9 8TdPCxy7L9XRFfqZlBJAo8cxRIPHpqKIaRy0wn616xCDfUSQ9NBLlDITL4d7tNvD C9hLpehFKMKIEct5WDfaQIWQe2o1fjVsU2Is2wXVmdi9A7X3q7yWVA766zQTxQO6 1TcgyoJM9k2DxncsmwXIa8oD6KP4VYtrtsx8r4VXPEjHucCjPe+qgyY65wBPXSl5 U21AiUuGGegFQwRD6L7ZqT3K5JLDlK/kkaV3l8i0onfJ+5CytOB2T6QPQnJ4Ynch K9w3EiyDrgzl0IpotQXxOBGHoCtcxUZvkNeOIxAb8QwkWnhgkljMyQ== =nV4h -----END PGP PUBLIC KEY BLOCK----- " DEVICE="" CLOUDINIT="" while getopts "V:C:d:o:c:i:t:b:nvh" OPTION do case $OPTION in V) VERSION_ID="$OPTARG" ;; C) CHANNEL_ID="$OPTARG" ;; d) DEVICE="$OPTARG" ;; o) OEM_ID="$OPTARG" ;; c) CLOUDINIT="$OPTARG" ;; i) IGNITION="$OPTARG" ;; t) export TMPDIR="$OPTARG" ;; v) set -x ;; b) BASE_URL="$OPTARG" ;; n) COPY_NET=1;; h) echo "$USAGE"; exit;; *) exit 1;; esac done # Device is required, must not be a partition, must be writable if [[ -z "${DEVICE}" ]]; then echo "$0: No target block device provided, -d is required." >&2 exit 1 fi if ! [[ $(lsblk -n -d -o TYPE "${DEVICE}") =~ ^(disk|loop|lvm)$ ]]; then echo "$0: Target block device (${DEVICE}) is not a full disk." >&2 exit 1 fi if [[ ! -w "${DEVICE}" ]]; then echo "$0: Target block device (${DEVICE}) is not writable (are you root?)" >&2 exit 1 fi if [[ -n "${CLOUDINIT}" ]]; then if [[ ! -f "${CLOUDINIT}" ]]; then echo "$0: Cloud config file (${CLOUDINIT}) does not exist." >&2 exit 1 fi if type -P coreos-cloudinit >/dev/null; then if ! coreos-cloudinit -from-file="${CLOUDINIT}" -validate; then echo "$0: Cloud config file (${CLOUDINIT}) is not valid." >&2 exit 1 fi else echo "$0: coreos-cloudinit not found. Could not validate config. Continuing..." >&2 fi fi if [[ -n "${IGNITION}" ]]; then if [[ ! -f "${IGNITION}" ]]; then echo "$0: Ignition config file (${IGNITION}) does not exist." >&2 exit 1 fi fi if [[ -n "${OEM_ID}" ]]; then IMAGE_NAME="coreos_production_${OEM_ID}_image.bin.bz2" else IMAGE_NAME="coreos_production_image.bin.bz2" fi # for compatibility with old versions that didn't support channels if [[ "${VERSION_ID}" =~ ^(alpha|beta|stable)$ ]]; then CHANNEL_ID="${VERSION_ID}" VERSION_ID="current" fi if [[ -z "${BASE_URL}" ]]; then BASE_URL="https://${CHANNEL_ID}.release.core-os.net/amd64-usr" fi # if the version is "current", resolve the actual version number if [[ "${VERSION_ID}" == "current" ]]; then VERSION_ID=$(wget --quiet -O - "${BASE_URL}/${VERSION_ID}/version.txt" | \ gawk --field-separator '=' '/COREOS_VERSION=/ { print $2 }') echo "Current version of CoreOS ${CHANNEL_ID} is ${VERSION_ID}" fi IMAGE_URL="${BASE_URL}/${VERSION_ID}/${IMAGE_NAME}" SIG_NAME="${IMAGE_NAME}.sig" SIG_URL="${BASE_URL}/${VERSION_ID}/${SIG_NAME}" if ! wget --spider --quiet "${IMAGE_URL}"; then echo "$0: Image URL unavailable: $IMAGE_URL" >&2 exit 1 fi if ! wget --spider --quiet "${SIG_URL}"; then echo "$0: Image signature unavailable: $SIG_URL" >&2 exit 1 fi # Pre-flight checks pass, lets get this party started! WORKDIR=$(mktemp --tmpdir -d coreos-install.XXXXXXXXXX) trap "error_output ; rm -rf '${WORKDIR}'" EXIT # Setup GnuPG for verifying the image signature export GNUPGHOME="${WORKDIR}/gnupg" mkdir "${GNUPGHOME}" gpg --batch --quiet --import <<<"$GPG_KEY" echo "Downloading the signature for ${IMAGE_URL}..." wget --no-verbose -O "${WORKDIR}/${SIG_NAME}" "${SIG_URL}" # We are at the point of no return, so wipe disk labels that are missed below. # In particular, ZFS writes labels in the last half-MiB of the disk. dd if=/dev/zero of="${DEVICE}" count=1024 2>/dev/null \ seek=$(($(blockdev --getsz "${DEVICE}") - 1024)) echo "Downloading, writing and verifying ${IMAGE_NAME}..." declare -a EEND if ! wget --no-verbose -O - "${IMAGE_URL}" \ | tee >(bunzip2 --stdout >"${DEVICE}") \ | gpg --batch --trusted-key "${GPG_LONG_ID}" \ --verify "${WORKDIR}/${SIG_NAME}" - then EEND=(${PIPESTATUS[@]}) [ ${EEND[0]} -ne 0 ] && echo "${EEND[0]}: Download of ${IMAGE_NAME} did not complete" >&2 [ ${EEND[1]} -ne 0 ] && echo "${EEND[1]}: Cannot expand ${IMAGE_NAME} to ${DEVICE}" >&2 [ ${EEND[2]} -ne 0 ] && echo "${EEND[2]}: GPG signature verification failed for ${IMAGE_NAME}" >&2 wipefs --all --backup "${DEVICE}" exit 1 fi # inform the OS of partition table changes udevadm settle for try in 0 1 2 4; do sleep "$try" # Give the device a bit more time on each attempt. blockdev --rereadpt "${DEVICE}" && unset try && break || echo "Failed to reread partitions on ${DEVICE}" >&2 done [ -z "$try" ] || exit 1 if [[ -n "${CLOUDINIT}" ]] || [[ -n "${COPY_NET}" ]]; then # The ROOT partition should be #9 but make no assumptions here! # Also don't mount by label directly in case other devices conflict. ROOT_DEV=$(blkid -t "LABEL=ROOT" -o device "${DEVICE}"*) mkdir -p "${WORKDIR}/rootfs" case $(blkid -t "LABEL=ROOT" -o value -s TYPE "${ROOT_DEV}") in "btrfs") mount -t btrfs -o subvol=root "${ROOT_DEV}" "${WORKDIR}/rootfs" ;; *) mount "${ROOT_DEV}" "${WORKDIR}/rootfs" ;; esac trap "error_output ; umount '${WORKDIR}/rootfs' && rm -rf '${WORKDIR}'" EXIT if [[ -n "${CLOUDINIT}" ]]; then echo "Installing cloud-config..." mkdir -p "${WORKDIR}/rootfs/var/lib/coreos-install" cp "${CLOUDINIT}" "${WORKDIR}/rootfs/var/lib/coreos-install/user_data" fi if [[ -n "${COPY_NET}" ]]; then echo "Copying network units to root partition." # Copy the entire directory, do not overwrite anything that might exist there, keep permissions, and copy the resolve.conf link as a file. cp --recursive --no-clobber --preserve --dereference /run/systemd/network/* "${WORKDIR}/rootfs/etc/systemd/network" fi umount "${WORKDIR}/rootfs" trap "error_output ; rm -rf '${WORKDIR}'" EXIT fi if [[ -n "${IGNITION}" ]]; then # The OEM partition should be #6 but make no assumptions here! # Also don't mount by label directly in case other devices conflict. OEM_DEV=$(blkid -t "LABEL=OEM" -o device "${DEVICE}"*) mkdir -p "${WORKDIR}/oemfs" mount "${OEM_DEV}" "${WORKDIR}/oemfs" trap "error_output ; umount '${WORKDIR}/oemfs' && rm -rf '${WORKDIR}'" EXIT echo "Installing Ignition config ${IGNITION}..." cp "${IGNITION}" "${WORKDIR}/oemfs/coreos-install.json" echo "set linux_append=\"coreos.config.url=oem:///coreos-install.json\"" > "${WORKDIR}/oemfs/grub.cfg" umount "${WORKDIR}/oemfs" trap "error_output ; rm -rf '${WORKDIR}'" EXIT fi rm -rf "${WORKDIR}" trap - EXIT echo "Success! CoreOS ${CHANNEL_ID} ${VERSION_ID}${OEM_ID:+ (${OEM_ID})} is installed on ${DEVICE}" |
・インストール
1 |
# coreos-install -d /dev/sda |
完了したらログインできるか確認してみた。
できないw
ググるとどうやらデフォルトのユーザーはcoreみたいだが、
パスは設定されていないことが分かった。
なんというセキュア。。てかどうすんだ。。
とりあえず公式にはこんなことが書いてあった。
https://coreos.com/os/docs/latest/booting-with-pxe.html
coreos.autologin: Drop directly to a shell on a given console without prompting for a password.
Useful for troubleshooting but use with caution.
For any console that doesn’t normally get a login prompt by default be sure to combine with the console option, e.g.
console=tty0 console=ttyS0 coreos.autologin=tty1 coreos.autologin=ttyS0.
Without any argument it enables access on all consoles.
Note that for the VGA console the login prompts are on virtual terminals (tty1, tty2, etc),
not the VGA console itself (tty0).
訳)
ログインプロンプトにautologinをぶち込めば一時的にログインしてやるぜ!
ちなみにCoreOSはCloud-Configに対応(AWSやDigitalOceanも)しており、
OS起動時にネットワーク、ユーザ、systemd、などなど設定してくれるのですが、
完全に忘れてました。。w
以下のようにymlファイルを作ってCoreOSインストール時に指定すれば上記なことをする必要ありません。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
~/cloud-config.yml #cloud-config coreos: units: - name: 10-static.network runtime: no content: | [Match] Name=enp0s8 [Network] Address=192.168.3.56/24 users: - name: core passwd: hahahaha groups: core |
・CoreOSインストールとcloud-config
1 |
# coreos-install -d /dev/sda -C stable -c cloud-config.yml |
■CoreOS初期設定
・ユーザーパス変更
・固定IPの変更
1 2 3 4 5 6 7 8 9 10 11 12 |
core@localhost ~ $ sudo vim /etc/systemd/network/static.network [Match] Name=enp6s0 [Network] Address=192.168.3.56/24 Gateway=192.168.3.1 DNS=192.168.3.1 core@localhost ~ $ sudo reboot |
1 |
# hostnamectl set-hostname adachin-docker |
1 2 3 4 5 6 7 8 9 10 11 |
core@adachin-docker ~ $ cat /etc/motd .d8888b. .d88888b. .d8888b. d88P Y88b d88P" "Y88bd88P Y88b 888 888 888 888Y88b. 888 .d88b. 888d888 .d88b. 888 888 "Y888b. 888 d88""88b888P" d8P Y8b888 888 "Y88b. 888 888888 888888 88888888888 888 "888 Y88b d88PY88..88P888 Y8b. Y88b. .d88PY88b d88P "Y8888P" "Y88P" 888 "Y8888 "Y88888P" "Y8888P" CoreOS stable (1122.2.0) |
■コンテナ起動
1 2 3 |
core@adachin-docker ~ $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ee594652ab55 tvirus17/nginx_centos6 "/bin/bash" 23 hours ago Up 23 hours 22/tcp, 80/tcp, 0.0.0.0:70->70/ tcp hungry_blackwell |
■まとめ
プロキシ設定していろいろやりたいところ。
今のところ検証用サーバとして十分。
KVMとかメンドクサイし、コンテナ構成管理楽ちん。
引き続きdockerの検証はブログでアウトプットします。
くにしーいなかったら大変だった。
ありがとうの意味を込めて、
父が酒を作ってたくさん飲んでくれました。
0件のコメント