I'm trying to install openssl from a Dockerfile manually. It's all working fine, until the last command source /etc/environment
.
I've tried RUN source /etc/environment
inside my Dockerfile, and source /etc/environment
in my entrypoint script but neither of them worked.
But if I run the command manually inside a running container, it works fine.
Any ideas why is this happening?
EDIT
This is the content of my Dockerfile. I don't have any errors building the image but the source doesn't seem to have any effect, unless I access the container and run it manually.
RUN wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz
RUN tar -xf openssl-1.1.1c.tar.gz
RUN cd openssl-1.1.1c; ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib; make; make test; make install
RUN echo "/usr/local/ssl/lib" > /etc/ld.so.conf.d/openssl-1.1.1c.conf
RUN mv /usr/bin/c_rehash /usr/bin/c_rehash.backup
RUN mv /usr/bin/openssl /usr/bin/openssl.backup
RUN echo "PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/ssl/bin"" > /etc/environment
RUN source /etc/environment