Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Docker build without cache #31

Open
DoStini opened this issue Apr 9, 2022 · 4 comments
Open

Docker build without cache #31

DoStini opened this issue Apr 9, 2022 · 4 comments

Comments

@DoStini
Copy link
Contributor

DoStini commented Apr 9, 2022

NIJobs had a problem deploying the new services at the master branch because it was using the cached version of the other branch

Shouldn't we use a --no-cache flag here?

https://github.com/NIAEFEUP/niployments/blob/4801cf6ab9385f270611ec303624b9937c1667d2/deployments/deploy-types.sh#L31

@imnotteixeira
Copy link
Collaborator

Which exactly was the problem? Can you post logs/give a better explanation: why was caching specifically a problem?

@DoStini
Copy link
Contributor Author

DoStini commented Apr 9, 2022

Since NIJobs project beta and master version use the same repository and dockerfiles and all that, the build is using cache of the develop version for example

@imnotteixeira
Copy link
Collaborator

imnotteixeira commented Apr 9, 2022

The image tag used when building the dockerfile will be different (nijobs-fe---master vs nijobs-fe---develop) [0], so it's essentially a different thing. The envfile is different, so the image should take those changes and build from there. They use the same base image of node,and (currently) the same npm dependencies, so that part could be cached (not sure if they are sharing that, since, again, the images are different)

I think we should really find the problem here, disabling docker cache outright is not a good solution. It means it will take way longer to build, and consume resources we need to actually serve the apps' user requests, so we should avoid that.


[0] https://github.com/NIAEFEUP/niployments/blob/4801cf6ab9385f270611ec303624b9937c1667d2/deployments/deploy-types.sh#L17

@miguelpduarte
Copy link
Collaborator

@imnotteixeira is right here, btw. The images are different so this should not be an issue. Was there anything that pointed to this being a problem?

There might be cache between deploys, but at most this should cache dependencies (depending on the order of the instructions in the Dockerfile) given that following steps will copy the code, which will be different for each deploy.

I'd say to close this as a false positive but I want to first confirm there is not another underlying issue at play here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants