title: How to accept the license agreement when building rti-connext-dds-5.3.1 with docker build?
body: <p>I am building an image from a Dockerfile that needs to install the package  <strong>rti-connext-dds-5.3.1</strong>. (It's one of the dependencies when <a href="https://github.com/ros2/ros2_documentation/blob/master/source/Installation/Linux-Development-Setup.rst#rti-connext-version-5-3-1-amd64-only" rel="nofollow noreferrer">building ROS2 on Linux</a>).</p>
  <p>The problem with that package is that it displays a license agreement that must be scrolled-down and then accepted by entering &quot;yes&quot; on the prompt. I cannot seem to set up the Dockerfile commands to auto-scroll and/or auto-accept this license agreement:</p>
  <p><a href="https://i.stack.imgur.com/MEQMo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MEQMo.png" alt="license agreement" /></a></p>
  <p>Pressing the <kbd>Enter</kbd> or <kbd>Space</kbd> key does not scroll the license down, it just displays blank lines. Pressing any other key/s just prints it out to the console. At this point, the build is stuck, and it can't proceed.</p>
  <p>Here is the Dockerfile:</p>
  <pre><code>FROM ubuntu:bionic
  
  ARG DEBIAN_FRONTEND=noninteractive
  RUN apt-get update &amp;&amp; \
      apt-get install -y apt-utils debconf-utils gnupg2 lsb-release &amp;&amp; \
      apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116 &amp;&amp; \
      echo &quot;deb http://packages.ros.org/ros2/ubuntu `lsb_release -sc` main&quot; &gt; /etc/apt/sources.list.d/ros2-latest.list &amp;&amp; \
      apt-get update &amp;&amp; \
      apt-get install -y rti-connext-dds-5.3.1
  
  WORKDIR /home
  </code></pre>
  <p>I already tried:</p>
  <ul>
  <li>Setting <code>DEBIAN_FRONTEND=noninteractive</code> different ways based on the answers from <a href="https://stackoverflow.com/q/22466255/2745495">Is it possible to answer dialog questions when installing under docker?</a></li>
  <li>Setting <code>DEBIAN_FRONTEND=teletype</code> based on <a href="https://stackoverflow.com/q/49049949/2745495">How to accept license agreement during docker build?</a></li>
  <li>Using <code>debconf-set-selections</code> based on <a href="https://unix.stackexchange.com/a/106553">apt-get install without debconf prompt</a>
  <pre><code># echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections &amp;&amp; \
  # echo &quot;rti-connext-dds-5.3.1 rti-connext-dds-5.3.1/license string y&quot; | debconf-set-selections &amp;&amp; \
  # echo &quot;rti-connext-dds-5.3.1 rti-connext-dds-5.3.1/license string yes&quot; | debconf-set-selections &amp;&amp; \
  </code></pre>
  </li>
  <li>Piping the <code>yes</code> command (this is worse, as I can't even abort with <kbd>Ctrl</kbd>+<kbd>C</kbd>)
  <pre><code># apt-get install -y -q rti-connext-dds-5.3.1
  # yes &quot;yes&quot; | apt-get install -y -q rti-connext-dds-5.3.1
  </code></pre>
  </li>
  </ul>
  <p>How do I auto-scroll and/or auto-accept the license during installation?</p>