[英]Dockerfile for Gluster... Can't get the service to start when the container is created
FROM ubuntu:latest
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:gluster/glusterfs-9 && \
apt-get update && \
apt-get install -y glusterfs-server
CMD ["/usr/sbin/init"]
使用它,容器可以完美啟動......但是正在安裝的服務(Gluster)沒有啟動。
我嘗試了 RUN、CMD 和 ENTRYPOINT 腳本的組合來執行“service glusterd start”(啟動 Gluster 守護進程的命令)的變體,但這些組合:
我可以確認“service glusterd start”是需要運行的正確命令,如:
關於如何在 dockerfile 中創建容器時執行“service glusterd start”的任何想法?
真正的功勞歸功於評論中的 DaveMaze……他關於 service/systemctl 和 CMD 的說明引導我走上了一條最終成功的道路:
FROM ubuntu:latest
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:gluster/glusterfs-9 && \
apt-get update && \
apt-get install -y glusterfs-server
CMD glusterd -N
完美運行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.