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

Faster image building iteration #227

Merged
merged 12 commits into from Sep 11, 2020
Merged

Faster image building iteration #227

merged 12 commits into from Sep 11, 2020

Conversation

michel-tricot
Copy link
Contributor

@michel-tricot michel-tricot commented Sep 11, 2020

What

Use the build from the local environment to build images instead of running the build in a container
Pros:

  • Fast, build incrementality
    Cons:
  • Potential side effect on the host system
  • running docker-compose -f xxx build now requires that gradle build was called before

As 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

Copy link
Contributor

@cgardens cgardens left a 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) {
Copy link
Contributor

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?

@michel-tricot michel-tricot changed the base branch from mt-fix-ngnix-spa to master September 11, 2020 18:37
@michel-tricot michel-tricot changed the title RFC: Faster image building iteration Faster image building iteration Sep 11, 2020
@michel-tricot michel-tricot merged commit 47905a8 into master Sep 11, 2020
@michel-tricot michel-tricot added area/developer Everything related to build, developer UX type/enhancement New feature or request labels Sep 11, 2020
@michel-tricot michel-tricot deleted the mt-fix-nginx branch September 11, 2020 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/developer Everything related to build, developer UX type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants