title: Docker Attach vs Exec
body: <p>I'm using a web socket connection to a container the docker using the Docker API. <a href="https://docs.docker.com/engine/api/v1.24/" rel="nofollow noreferrer">https://docs.docker.com/engine/api/v1.24/</a> (search for websocket)</p>
  
  <p>My only problem is that the container is running a script as a command <code>/tools/script.sh</code> and when I use attach I can only see the logs of the script instead of actually connecting to the linux environment.</p>
  
  <p>Is there a way to run a script command and be able to use docker attach?</p>
  
  <p><code>docker exec -ti container bash</code> works but there's no web socket implementation in javascript</p>