This is the script in Dockerfile. When I directly get into the docker and run the commands manually it is working fine but why not from the Dockerfile.
Dockerfile:
FROM ubuntu:16.04
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get update
RUN apt-get install -y build-essential libssl-dev
RUN apt-get install -y curl git sudo
RUN curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh -o install_nvm.sh
RUN /bin/sh install_nvm.sh
RUN source ~/.profile
Error:
mesg: ttyname failed: Inappropriate ioctl for device
I have tried few of the solutions found like running it as
RUN /bin/sh -c "source ~/.profile"
and few more but not solving the issue.
This is very similar to this question: How to solve 'ttyname failed: Inappropriate ioctl for device' in Vagrant?
In ~/.profile
there is a line:
mesg n || true
That is incompatible. In order to fix it, make it conditional upon if tty is available (credit Gogowitsch):
RUN sed -i ~/.profile -e 's/mesg n || true/tty -s \&\& mesg n/g'
This sed command replaces mesg n || true
(try it, and ignore if it fails) with tty -s && mesg n
, (only try it if it will succeed) which makes the error message go away
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With