やる気がストロングZERO

やる気のストロングスタイル

【Docker Ceotos7】systemctlが使えるようにする

dockerでcentos7のコンテナを作って普通にsystemctlを使うと怒られる

# systemctl

Failed to get D-Bus connection: Operation not permitted

privilegedオプションを有効化し、/sbin/initで起動してやると使えるようになるらしい。

version: '3'

services:
  master:
    image: centos:centos7
    privileged: true
    command: /sbin/init && tail -f /dev/null