Skip to content

Image too large; split extras to separate tag? #52

Description

@lutzky

From #38 (comment):

I'm considering reverting this change, as fava-portfolio-returns depends on beangrow, which in turn depends on scipy. As the results of that dependency, the fava docker image is ballooning from ~60MiB to ~150MiB (with the uncompressed image to ~500MiB when inspected using https://github.com/wagoodman/dive).

Maybe it's better to build with this dependency with vxxx-extras and latest-extras labels, so that people can choose between a minimum setup and a full-featured setup. But I'm not sure how to do that the best with a combination of the Dockerfile and the actions workflow....

I like it! Here's what I'm thinking: We can use build variables for this.

  • In the github workflow, add a matrix for two build_variant options - normal and extras.
  • In the Build and push Docker image step:
    • Set the tags to conditionally add -extras as appropriate.
    • Add build-args: [BUILD_VARIANT=${{ matrix.build_variant }}]
  • Split requirements.txt so some of it is in requirements-extra.txt.
  • In Dockerfile, add ARG BUILD_VARIANT. Only perform the extra pip3 install steps for the extra variant.

What do you think?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions