title: Error /dev/tty: No such device or address when installing sqlcmd inside docker
body: <p>I wanted to install sql cmd in my docker image.
  My dockerfile has these commands to install sqlcmd (centos 7 base image)</p>
  
  <pre><code>RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo &gt; /etc/yum.repos.d/msprod.repo
  RUN yum remove mssql-tools unixODBC-utf16-devel
  RUN yum install -y unixODBC-devel mssql-tools
  </code></pre>
  
  <p>Below is the docker build logs</p>
  
  <pre><code>Transaction test succeeded
  Running transaction
    Updating   : libcom_err-1.42.9-17.el7.x86_64                             1/14
    Installing : unixODBC-2.3.7-1.rh.x86_64                                  2/14
    Updating   : libss-1.42.9-17.el7.x86_64                                  3/14
    Installing : e2fsprogs-libs-1.42.9-17.el7.x86_64                         4/14
    Installing : e2fsprogs-1.42.9-17.el7.x86_64                              5/14
    Updating   : 1:openssl-libs-1.0.2k-19.el7.x86_64                         6/14
    Installing : 1:make-3.82-24.el7.x86_64                                   7/14
    Installing : 1:openssl-1.0.2k-19.el7.x86_64                              8/14
  /var/tmp/rpm-tmp.8S1dKq: line 17: /dev/tty: No such device or address
  error: %pre(msodbcsql17-17.5.2.1-1.x86_64) scriptlet failed, exit status 1
  Error in PREIN scriptlet in rpm package msodbcsql17-17.5.2.1-1.x86_64
  error: msodbcsql17-17.5.2.1-1.x86_64: install failed
  /var/tmp/rpm-tmp.tObfQB: line 4: /dev/tty: No such device or address
  error: %pre(mssql-tools-17.5.2.1-1.x86_64) scriptlet failed, exit status 1
  Error in PREIN scriptlet in rpm package mssql-tools-17.5.2.1-1.x86_64
    Installing : unixODBC-devel-2.3.7-1.rh.x86_64                           11/14
  error: mssql-tools-17.5.2.1-1.x86_64: install failed
    Cleanup    : 1:openssl-libs-1.0.2k-8.el7.x86_64                         12/14
    Cleanup    : libss-1.42.9-10.el7.x86_64                                 13/14
    Cleanup    : libcom_err-1.42.9-10.el7.x86_64                            14/14
    Verifying  : libss-1.42.9-17.el7.x86_64                                  1/14
  </code></pre>
  
  <p>When i run this installation command manually inside the container's terminal using docker exec   then it works fine.
  If i run this command directly in a linux machine it works fine.
  only when i am building a docker image using docker build i am getting the error /dev/tty: No such device or address</p>