我正在容器化最新版本的grafana,並希望在容器啓動時啓動grafana-process
,然後在我的K8S(kubernetes)羣集中使用它。Docker - 進程不在啓動時啓動
我Dockerfile樣子:
FROM armdocker/baseimages/rhel:7-20161207
MAINTAINER xxxxxxxx
ENV GRAFANA_VERSION_MAJOR=4 GRAFANA_VERSION_MINOR=4 GRAFANA_VERSION_PATCH=3-1
ENV GRAFANA_VERSION=${GRAFANA_VERSION_MAJOR}.${GRAFANA_VERSION_MINOR}.${GRAFANA_VERSION_PATCH}
RUN yum clean all && yum install -y unzip tar
RUN curl -f -L -o grafana-${GRAFANA_VERSION}.x86_64.rpm https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${GRAFANA_VERSION}.x86_64.rpm && \
yum localinstall grafana-${GRAFANA_VERSION}.x86_64.rpm -y
EXPOSE 3000
ENTRYPOINT ["/etc/init.d/grafana-server start"]
構建Dockerfile成功並返回沒有錯誤。
當我試圖運行這個圖像時,我得到了錯誤。
docker run -dit -p 3000:3000 armdocker/proj/grafana:1.0.5
471b2acb964caad69bbb78831a59ee9d2b27997911b5b104b0057ddc957d1101
Error response from daemon: Cannot start container 471b2acb964caad69bbb78831a59ee9d2b27997911b5b104b0057ddc957d1101: [8] System error: exec: "/etc/init.d/grafana-server start": stat /etc/init.d/grafana-server start: no such file or directory
這似乎是很奇怪的,因爲我是第一次安裝RPM(這使得文件/etc/init.d/grafana-server
),然後我試圖啓動過程,我ENTRYPOINT
然後我試圖
CMD ["/etc/init.d/grafana-server start"]
這也導致了同樣的錯誤/etc/init.d/grafana-server start: no such file or directory
我然後使用嘗試10命令:
docker run -dit -p 3000:3000 armdocker/proj/grafana:1.0.6
bfd492c75a0f4c284fc0fdbd5a590f0155f6f67bcb4834e144f344bb789546f3
Error response from daemon: Cannot start container bfd492c75a0f4c284fc0fdbd5a590f0155f6f67bcb4834e144f344bb789546f3: [8] System error: exec: "/bin/systemctl start grafana-server.service": stat /bin/systemctl start grafana-server.service: no such file or directory
我不知道我在做什麼錯誤,有一個啓動grafana過程的容器。
'ENTRYPOINT [「/etc/init.d/grafana-server」]' 'CMD [「start」]' – johnharris85