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

Re-organize Dockerfile to improve incremental builds. #10212

Merged
merged 1 commit into from
Mar 8, 2019

Conversation

BenLubar
Copy link
Contributor

@BenLubar BenLubar commented Mar 7, 2019

  • Always run apt update before any other apt command. (This fixes
    incremental builds failing if a remote package is updated.)
  • Only copy dependency lists before installing dependencies. (This means
    editing code doesn't force all dependencies to be re-downloaded.)
  • Delete cache in the same layer that it is created. (Otherwise,
    deleting cache increases the size of the image on non-squashed
    builds.)
  • Move the installation of some static dependencies to before Mastodon
    code is imported to Docker.

- Always run apt update before any other apt command. (This fixes
  incremental builds failing if a remote package is updated.)
- Only copy dependency lists before installing dependencies. (This means
  editing code doesn't force all dependencies to be re-downloaded.)
- Delete cache in the same layer that it is created. (Otherwise,
  deleting cache *increases* the size of the image on non-squashed
  builds.)
- Move the installation of some static dependencies to *before* Mastodon
  code is imported to Docker.
@Gargron
Copy link
Member

Gargron commented Mar 7, 2019

I believe this is the kind of back-and-forth I was warning against @Sir-Boops #10100

@BenLubar
Copy link
Contributor Author

BenLubar commented Mar 7, 2019

This runs all the same code, just in a different order that's friendlier to the build cache.

@Sir-Boops
Copy link
Contributor

I question the weird way this COPYs the masto src around but other then that It's a nice cleanup UwU

I don't know what you mean about 'back-and-forth'

@Gargron Gargron merged commit d36fcb5 into mastodon:master Mar 8, 2019
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
- Always run apt update before any other apt command. (This fixes
  incremental builds failing if a remote package is updated.)
- Only copy dependency lists before installing dependencies. (This means
  editing code doesn't force all dependencies to be re-downloaded.)
- Delete cache in the same layer that it is created. (Otherwise,
  deleting cache *increases* the size of the image on non-squashed
  builds.)
- Move the installation of some static dependencies to *before* Mastodon
  code is imported to Docker.
messenjahofchrist pushed a commit to Origin-Creative/mastodon that referenced this pull request Jul 30, 2021
- Always run apt update before any other apt command. (This fixes
  incremental builds failing if a remote package is updated.)
- Only copy dependency lists before installing dependencies. (This means
  editing code doesn't force all dependencies to be re-downloaded.)
- Delete cache in the same layer that it is created. (Otherwise,
  deleting cache *increases* the size of the image on non-squashed
  builds.)
- Move the installation of some static dependencies to *before* Mastodon
  code is imported to Docker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants