我正在使用 rhel7 创建谷歌云虚拟机,并在尝试使用 dockerfile 镜像构建 docker 镜像而不是构建 docker 后安装 docker。
FROM rhel
RUN yum update -y
yum install -y \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel
ENV JAVA_HOME /etc/alternatives/jre
来自守护程序的错误响应:未知指令:。
最佳答案
您可以使用,
FROM registry.access.redhat.com/rhel7/rhel
MAINTAINER John W. Jones <jjones@example.com>
# Add Web server, update image, and clear cache
RUN yum -y install httpd && yum -y update; yum clean all
# Add some data to web server
RUN echo "This Web server is working." > /var/www/html/index.html
EXPOSE 80
ENTRYPOINT [ "/usr/sbin/httpd" ]
CMD [ "-D", "FOREGROUND" ]
( ref .)
关于java - 如何使用 Rhel 创建 Dockerfile 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54400733/