为什么docker容器会立即退出我在后台运行一个容器 docker run -d --name hadoop h_Service它快速退出。但如果我在前台运行,它运行正常。我使用了检查日志docker logs hadoop没有错误。有任何想法吗?DOCKERFILE FROM java_ubuntu_new
RUN wget http://archive.cloudera.com/cdh4/one-click-install/precise/amd64/cdh4-repository_1.0_all.deb
RUN dpkg -i cdh4-repository_1.0_all.deb
RUN curl -s http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh/archive.key | apt-key add -
RUN apt-get update
RUN apt-get install -y hadoop-0.20-conf-pseudo
RUN dpkg -L hadoop-0.20-conf-pseudo
USER hdfs
RUN hdfs namenode -format
USER root
RUN apt-get install -y sudo
ADD . /usr/local/
RUN chmod 777 /usr/local/start-all.sh
CMD ["/usr/local/start-all.sh"]start-all.sh #!/usr/bin/env bash
/etc/init.d/hadoop-hdfs-namenode start
/etc/init.d/hadoop-hdfs-datanode start
/etc/init.d/hadoop-hdfs-secondarynamenode start
/etc/init.d/hadoop-0.20-mapreduce-tasktracker start
sudo -u hdfs hadoop fs -chmod 777 /
/etc/init.d/hadoop-0.20-mapreduce-jobtracker start
/bin/bash
3 回答
GCT1015
TA贡献1827条经验 获得超4个赞
这对我有用:
docker run -dit ubuntu
之后,我检查了运行的进程:
docker ps -a
用于再次连接容器
docker attach CONTAINER_NAME
提示:要在不停止容器类型的情况下退出: ^P^Q
添加回答
举报
0/150
提交
取消