# Is it possible to make precompilation portable (for docker images built with a different CPU)?

**URL:** <https://discourse.julialang.org/t/is-it-possible-to-make-precompilation-portable-for-docker-images-built-with-a-different-cpu/95913>\
**Category:** General Usage\
**Created:** [March 11, 2023, 11:07am UTC](https://discourse.julialang.org/t/is-it-possible-to-make-precompilation-portable-for-docker-images-built-with-a-different-cpu/95913 "2023-03-11T11:07:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![robsmith11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robsmith11/32/29641_2.png) [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Post date:** [March 11, 2023, 11:07am UTC](https://discourse.julialang.org/t/is-it-possible-to-make-precompilation-portable-for-docker-images-built-with-a-different-cpu/95913/1 "2023-03-11T11:07:52Z")

</div>

I recently realized why my docker images were taking ages to restart on production servers, but were much faster on dev servers (which happen to have the same CPU as the build servers). Precompilation is being done and saved during the building of docker images, but it looks like it’s only being used when run on servers with the same CPU family as the one on which they were built… which makes sense.

So is there any way to force precompilation to be done in a more portable way so that it will run on both recent Xeon and Ryzen servers?

---

<div class="post-metadata">

**Author:** ![robsmith11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robsmith11/32/29641_2.png) [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Post date:** [May 15, 2023, 3:11pm UTC](https://discourse.julialang.org/t/is-it-possible-to-make-precompilation-portable-for-docker-images-built-with-a-different-cpu/95913/2 "2023-05-15T15:11:21Z")

</div>

Found a solution:

```julia
ENV JULIA_CPU_TARGET haswell,clone_all

```
