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守护进程的命令)的变体,但是这些组合:
我可以确认“服务启动”是需要运行的正确命令,如下所示:
对于如何在dockerfile中的容器创建中执行"service glusterd start“,有什么想法吗?
发布于 2021-10-22 03:02:57
真正的功劳归于DaveMaze的评论.他关于服务/系统CMD和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效果很好。
https://stackoverflow.com/questions/69665897
复制相似问题