The problem of setting environment variables in Dockerfie ENV

the resources required by the add command in dockerfile

wget https://download.java.net/openjdk/jdk8u40/ri/openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.32/bin/apache-tomcat-8.5.32.tar.gz
wget http://download.redis.io/releases/redis-4.0.0.tar.gz
-sharp bash images
FROM centos

-sharp 
MAINTAINER fwq

-sharp 
RUN yum install -y gcc tcl && yum imstall -y make

-sharp jdk
ADD openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz /home/centos/docker/db/
-sharp tomcat
ADD apache-tomcat-8.5.32.tar.gz /home/centos/docker/db/
-sharp redis
ADD redis-4.0.0.tar.gz /home/centos/docker/db/

-sharp 
RUN /bin/sh -c "cd redis-4.0.0/  && make && cd src  && mkdir /home/centos/docker/db/usr  && cp redis-server /home/centos/docker/db/usr/redis-server  && cp /home/centos/docker/db/redis-4.0.0/redis.conf /home/centos/docker/db/usr/redis.conf"

-sharp 
ENV JAVA_HOME /home/centos/docker/db/java-se-8u40-ri
ENV JRE_HOME /home/centos/docker/db/java-se-8u40-ri/jre
ENV CATALINA_HOME /home/centos/docker/db/apache-tomcat-8.5.32
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin

-sharp 
EXPOSE 8080
EXPOSE 6379
EXPOSE 8000
EXPOSE 80

-sharp 
CMD ["/home/centos/docker/db/apache-tomcat-8.5.32/bin/catalina.sh","run"]
CMD ["/home/centos/docker/db/usr/redis-server","run"]

Dockerfile content as above
can create images normally and the environment variables set by the container ENV do not work. I don"t know what went wrong.

Mar.22,2021

you can put environment variables in the / etc/profile file to take effect

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c2c4-2bb07.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c2c4-2bb07.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?