title: Deploy to elasticbeanstalk via CLI deploy command with Dockerrun.aws.json
body: <p>I am running an elasticbeanstalk application, with multiple environments. This particular application is hosting docker containers which host a webservice.</p>
  
  <p>To upload and deploy a new version of the application to one of the environments, I can go through the web client and click on "Upload and Deploy" and from the file option I select my latest Dockerrun.aws.json file, which references the latest version of the container that is privately hosted. The upload and deploy works fine and without issue.</p>
  
  <p>To make it simpler for myself and others to deploy I'd like to be able to use the CLI to upload and deploy the Dockerrun.aws.json file. If I use the cli <code>eb deploy</code> command without any special configuration the normal process of zipping up the whole application and sending it to the host occurs and fails (it cannot reason out that it only needs to read the Dockerrun.aws.json file).</p>
  
  <p>I found a documentation tidbit about controlling what is uploaded using the .elasticbeanstalk/config.yml file.</p>
  
  <p>Using this syntax: </p>
  
  <p><code>
  deploy:
    artifact: Dockerrun.aws.json
  </code></p>
  
  <p>The file is uploaded and actually deploys successfully to the first batch of instances, and then always fails to deploy to the second set of instances.</p>
  
  <p>The failure error is of the flavor: 'container exited unexpectedly...'</p>
  
  <p>Can anyone explain, or provide link to the canonical approach for using the CLI to deploy single docker container applications?</p>