Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve caching of docker layers #227

Open
bajtos opened this issue May 21, 2024 · 0 comments
Open

Improve caching of docker layers #227

bajtos opened this issue May 21, 2024 · 0 comments

Comments

@bajtos
Copy link
Member

bajtos commented May 21, 2024

Rework Dockerfile to use the same structure as we have in spark-api: https://github.com/filecoin-station/spark-api/blob/main/Dockerfile

The current Dockerfile script is slowing down our deployment.

 => CACHED [build 1/5] RUN apt-get update -qq && 
    apt-get install -y python-is-python3 pkg-config build-essential                                                                                    
 => CACHED [build 2/5] COPY --link package.json package-lock.json .                                                                                                                                     
 => CACHED [build 3/5] RUN npm install --production=false                                                                                                                                               
 => [build 4/5] COPY --link . .                                                                                                                                                                         
 => [build 5/5] RUN npm prune --production

Notice that Docker loaded the first three layers from the cache. Then we copied the modified files, this was not cached as expected. As a result, layer 5 (the npm prune step) had to be recomputed again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant