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
Faster image building iteration #227
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential side effect on the host system
I think we can skirt this by using reproducible builds in gradle. i started messing with them a little yesterday.
Do we understand why things are so much slower in the docker container? I know that when I run clean build locally it is faster versus in the docker container, so it's not just that some modules don't need to be recompiled.
Would moving node modules fetching into their own docker image be worthwhile like what you did with build-base?
Leaving a comment because I think I need some info before I cast a vote.
@@ -138,3 +138,9 @@ subprojects { | |||
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.4.6' | |||
} | |||
} | |||
|
|||
task composeBuild(type: Exec) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running docker-compose -f xxx build now requires that gradle build was called before
the way you have it setup here, won't gradle build just run docker-compose etc... which removes this con that you mentioned?
What
Use the build from the local environment to build images instead of running the build in a container
Pros:
Cons:
docker-compose -f xxx build
now requires that gradle build was called beforeAs we iterate on getting things to work, that will save us a LOT of time
How
Each project which generate an artifact has a dockerfile which copies from the project directory
to build and docker-compose build:
./gradlew composeBuild
. It will build the code and build the image local