polyswarm / relay

Sidechain relay for PolySwarm, the first decentralized threat intelligence market.
https://polyswarm.io
GNU General Public License v3.0
2 stars 1 forks source link

removing multi-stage to use --cache-from in a more efficient way #81

Closed ghost closed 5 years ago

ghost commented 5 years ago

Multi-stage builds prevent cache from being used for new builds. For instance, when running CI, we would probably do

docker pull relay:lastest
docker build --cache-from=relay:lastest -t relay:new-image .

Since we are pushing only the last image, the first images are not in the cache at this point, and need to be rebuilt. Since we can achieve the same functionality with a single stage image, I modified it in order to use rust:1.31.1 as the base image (which is also the version being used in .gitlab-ci.yml for testing --- we should probably look into ways of getting this version from a single place to have a parity between tests and the image that is being built).

Related issues are:

https://github.com/moby/moby/issues/34715 https://github.com/moby/moby/issues/33002