I am trying to set up a docker image that downloads Phantomjs
and sets up the alias in ~/.bash_rc
and path in ~/.profile
. Below is the Dockerfile
that does this.
FROM node:8.9.4
RUN mkdir -p /usr/src/app
RUN wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 \
&& tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2
RUN mv phantomjs-2.1.1-linux-x86_64 /usr/src/app
WORKDIR /usr/src/app
COPY package*.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
RUN . usr/src/app/test.sh
RUN . ~/.bashrc
RUN . ~/.profile
EXPOSE 4219
CMD ["node_modules/casperjs/bin/casperjs","selftest"]
Also the script test.sh sets up the environment variable. Here are the contents of the script.
#!/bin/sh
echo "alias phantomjs='/usr/src/app/phantomjs-2.1.1-linux-x86_64/bin/phantomjs'" >> ~/.bashrc
echo "PATH=\"$HOME/bin:$HOME/.local/bin:$PATH:/usr/src/app/phantomjs-2.1.1-linux-x86_64/bin\"" >> ~/.profile
But it returns this error now
Step 10/16 : RUN . ~/.profile
---> Running in 87cdccc4fef7
stdin: is not a tty
What should I do to make this script run?