我在fedora 22上的dockerfile
FROM java:latest
ENV HBASE_VERSION=1.1.0.1
RUN groupadd -r hbase && useradd -m -r -g hbase hbase
USER hbase
ENV HOME=/home/hbase
# Download'n extract hbase
RUN cd /home/hbase && \
wget -O - -q \
http://apache.mesi.com.ar/hbase/${HBASE_VERSION}/hbase-${HBASE_VERSION}-bin.tar.gz \
| tar --strip-components=1 -zxf -
# Upload local configuration
ADD ./conf/ /home/hbase/conf/
USER root
RUN chown -R hbase:hbase /home/hbase/conf
USER hbase
# Prepare data volumes
RUN mkdir /home/hbase/data
RUN mkdir /home/hbase/logs
VOLUME /home/hbase/data
VOLUME /home/hbase/logs
# zookeeper
EXPOSE 2181
# HBase Master API port
EXPOSE 60000
# HBase Master Web UI
EXPOSE 60010
# Regionserver API port
EXPOSE 60020
# HBase Regionserver web UI
EXPOSE 60030
WORKDIR /home/hbase
CMD /home/hbase/bin/hbase master start
当我从java:latest“我当前的dockerfile覆盖在那个dockerfile上,所以java\u home必须设置为java:latest? 我说得对吗?这个dockerfile是构建的,但是当我看到“docker run”图像时,它显示“java\u home not found”错误。如何正确设置?
2条答案
按热度按时间q43xntqr1#
添加到
~./bashrc
(或全球)/etc/bashrc
:zz2j4svz2#
使用env指令,比如
ENV JAVA_HOME //def
医生https://docs.docker.com/reference/builder/#env