# Aws-ecr/build-and-push-image is slow

**URL:** <https://discuss.circleci.com/t/aws-ecr-build-and-push-image-is-slow/40131>\
**Category:** Build Environment\
**Tags:** docker, circle-yml\
**Created:** [May 20, 2021, 4:04pm UTC](https://discuss.circleci.com/t/aws-ecr-build-and-push-image-is-slow/40131 "2021-05-20T16:04:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewchou](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/andrewchou/32/27383_2.png) [@andrewchou](https://discuss.circleci.com/u/andrewchou)\
**Post date:** [May 20, 2021, 4:04pm UTC](https://discuss.circleci.com/t/aws-ecr-build-and-push-image-is-slow/40131/1 "2021-05-20T16:04:06Z")

</div>

Sorry noob question since I’m new to circleci but it takes about 15 minutes to build my Dockerfile that I’m specifying in aws-ecr/build-and-push-image so I want to cache some of the layers.

I’ve tried 2 different ways but am still stuck:  
1: When defining your own job I’ve seen that you can say  
machine:  
docker\_layer\_caching: true  
but where would I put this when using an orb like aws-ecr/build-and-push-image?

2: This orb has params for  
executor: docker  
remote-docker-layer-caching: true  
setup-remote-docker: true

but if I don’t give an executor it keeps saying

“Error: 1 error occurred:  
\* step 2 setup\_remote\_docker: step is not compatible with machine executor. You can use Docker without a special step if the build image has it installed.”  
and if I do pass

`executor: docker`

then it says  
“Cannot find a definition for executor named remote-docker”

Any suggestions?  
Thanks!

---

<div class="post-metadata">

**Author:** ![tdondich](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/tdondich/32/18894_2.png) [@tdondich](https://discuss.circleci.com/u/tdondich)\
**Post date:** [March 27, 2022, 2:27pm UTC](https://discuss.circleci.com/t/aws-ecr-build-and-push-image-is-slow/40131/2 "2022-03-27T14:27:25Z")

</div>

Did you find a solution to this? It looks like the only executor is a machine type. I might think of forking the orb source to include an additional executor type. Was wondering if you had any solution?
