title: Jenkinsfile with writeFile inside docker container?
body: <p>If I have a Jenkinsfile with</p>
  
  <pre><code>docker.image('foo').inside {
      writeFile file: bar, text: baz
  }
  </code></pre>
  
  <p>the file gets written to the Jenkins agent's workspace, not inside the container, right? Is there a sane way to write a file inside a container?</p>
  
  <p>The closest thing I was able to find on the web is <a href="https://issues.jenkins-ci.org/browse/JENKINS-33510" rel="nofollow noreferrer">https://issues.jenkins-ci.org/browse/JENKINS-33510</a>. I suppose I could use a <code>sh</code> step with a here-doc, but that sounds pretty ugly.</p>