私はdockerでelasticsearchを実行しようとしています。 Docker centos7 systemctl deosが動作しない:Dバスに接続できません
- 以下、ホスト・システムのような
マイ機能:OSX 10.12.5
- ドッキングウィンドウ:17.05.0-CE
- ドッキングウィンドウの操作イメージ:
centos:latest
私はthis articleに従っていました
、それはsystemctl daemon-reload
でつかまった。
私はこのD-bus
についてCentOS official respondが見つかりましたが、docker run
コマンドを実行すると、以下のメッセージが表示されます。 [!!!!!!] Failed to mount API filesystems, freezing.
どうすればこの問題を解決できますか?
FYI、ここでDockerfile
は私がイメージ
FROM centos
MAINTAINER juneyoung <[email protected]>
ARG u=elastic
ARG uid=1000
ARG g=elastic
ARG gid=1000
ARG p=elastic
# add USER
RUN groupadd -g ${gid} ${g}
RUN useradd -d /home/${u} -u ${uid} -g ${g} -s /bin/bash ${u}
# systemctl settings from official Centos github
# https://github.com/docker-library/docs/tree/master/centos#systemd-integration
ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;
VOLUME [ "/sys/fs/cgroup" ]
# yum settings
RUN yum -y update
RUN yum -y install java-1.8.0-openjdk.x86_64
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/jre/
# install wget
RUN yum install -y wget
# install net-tools : netstat, ifconfig
RUN yum install -y net-tools
# Elasticsearch install
ENV ELASTIC_VERSION=5.4.0
RUN rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
RUN wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTIC_VERSION}.rpm
RUN rpm -ivh elasticsearch-${ELASTIC_VERSION}.rpm
CMD ["/usr/sbin/init"]
を構築するものであると私はコマンドで@Robertへ
docker run -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro --name=elastic2 elastic2
コンテナの内部に 'systemd'が必要なのはなぜですか?通常の方法ではありません – Robert
@Robertありがとう! –
あなたは大歓迎です! – Robert