title: Can I replicate `create-with-container` gcloud sdk command using the googleapiclient python client
body: <p>I currently have a docker container on the gcloud container repository which I want to launch an instance of in order to run a calculation, save a result and close:</p>
  <pre><code>gcloud compute instances create-with-container test-1 \
  --machine-type=n1-standard-4 \
  --boot-disk-size=20GB \
  --container-image=eu.gcr.io/&lt;container-link&gt; \
  --container-env=GCLOUD_INPUT_FILENAME=file.txt \
  --container-env=GCLOUD_PROJECT=project-name
  </code></pre>
  <p>However, I want to be able to launch these instances using a web-interface (flask) which implies I want to use the <a href="https://github.com/googleapis/google-api-python-client" rel="noreferrer">googleapiclient</a> (python) in order to create and manage these instances:</p>
  <p>It looks like while you can create a instance creation order using the discovery api:</p>
  <pre class="lang-py prettyprint-override"><code>compute = googleclientapi.discovery.build('compute', 'v1')
  compute.instances().insert(...).execute()
  </code></pre>
  <p>but it doesn't look like it is possible to emulate <code>create-with-container</code> gcloud sdk command, although you can pass 'machineImage' as part of the creation request.</p>
  <p>Can one create a compute instance 'with-container' without using <code>subprocess</code> to call the gcloud sdk</p>
  <p>OR</p>
  <p>Can I convert my <code>create-with-container</code> instance into a machine image and then use the <code>googleapi client</code>?</p>