title: Push data from bitbucket pipeline to ECS as volume
body: <p>I'm trying to set up a Bitbucket pipeline to run PHP application. The application itself will be running using separate containers for <code>nginx</code> and <code>php-fpm</code> so both will need application source code directory to operate similar to this snippet: </p>
  
  <pre><code>{
    "AWSEBDockerrunVersion": 2,
    "volumes": [
      {
        "name": "php-app",
        "host": {
          "sourcePath": "/var/app/current/php-app"
        }
      },
      {
        "name": "nginx-proxy-conf",
        "host": {
          "sourcePath": "/var/app/current/proxy/conf.d"
        }
      }  
    ],
    "containerDefinitions": [
      {
        "name": "php-app",
        "image": "php:fpm",
        "essential": true,
        "memory": 128,
        "mountPoints": [
          {
            "sourceVolume": "php-app",
            "containerPath": "/var/www/html",
            "readOnly": true
          }
        ]
      },
      {
        "name": "nginx-proxy",
        "image": "nginx",
        "essential": true,
        "memory": 128,
        "portMappings": [
          {
            "hostPort": 80,
            "containerPort": 80
          }
        ],
        "links": [
          "php-app"
        ],
        "mountPoints": [
          {
            "sourceVolume": "php-app",
            "containerPath": "/var/www/html",
            "readOnly": true
          },
          {
            "sourceVolume": "nginx-proxy-conf",
            "containerPath": "/etc/nginx/conf.d",
            "readOnly": true
          },
          {
            "sourceVolume": "awseb-logs-nginx-proxy",
            "containerPath": "/var/log/nginx"
          }
        ]
      }
    ]
  }
  </code></pre>
  
  <p>(source: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_ecstutorial.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_ecstutorial.html</a> )</p>
  
  <p>For this reason I don't want to embed application source within images (I could run <code>COPY</code> to both <code>nginx</code> and <code>php-fpm</code> but it wouldn't be nice) and I would like to have source stored within a volume. </p>
  
  <p>The question is: how can I push application after it's built (I have custom bitbucket agent with composer and stuff) to ECR so that I can use it in task definition?</p>