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

Dockerfile upgrade #1541

Merged
merged 8 commits into from
Jan 2, 2023
Merged

Dockerfile upgrade #1541

merged 8 commits into from
Jan 2, 2023

Conversation

alexiswl
Copy link
Contributor

@alexiswl alexiswl commented Sep 4, 2021

  • This comment contains a description of changes (with reason)
    • Use alpine:3.13 as base image for multi-arch build of dockerfile
      • Multiarch images can be built through docker buildx like so on a docker swarm running on multiple platforms:
        docker buildx build --platform linux/amd64,linux/arm64 --progress plain --push --tag ewels/multiqc:latest .
      • See docker buildx for more info
    • Maintain *-dev apk packages through installation of multiqc (for packages without pre-compiled binaries (i.e kiwisolver)
    • Added non-root USER for safer container invocation
      • See more info here
    • Moved from ENTRYPOINT to CMD for CWL conformance.
      • See more info here
  • CHANGELOG.md has been updated

* Use alpine:3.13 as base image for multi-arch build of dockerfile
* Maintain *-dev packages through installation of multiqc (for packages without pre-compiled binaries (i.e kiwisolver)
* Added non-root USER for safer container invocation
* Moved from entrypoint to CMD for CWL conformance.
@gartician gartician mentioned this pull request Oct 11, 2021
11 tasks
ewels and others added 2 commits November 15, 2021 23:59
* Updated docker file to have continuous commentary and delete the source directory
* Updated to alpine 3.15 and install wheel through apk instead.
Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - looks good, couple of minor questions but otherwise no problems.

Out of curiosity, does the final image size end up being about the same?

Would also be nice to check for a couple of other bonus packages if we're building everything ourselves. For example, ps for Nextflow if it's not already there..

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Also, remove the default CMD and update the docs.
@ewels
Copy link
Member

ewels commented Dec 31, 2022

  • Removed the matplotlib and numpy installations
  • Removed the CMD completely
  • Updated the docs

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I can't get it to build locally - not sure if I broke something or if it was problematic from the start (I'm on a MacBook M1, so docker can have issues sometimes).

Could try adding --prefer-binary from the docs you linked maybe? Bedtime for me..

@ewels
Copy link
Member

ewels commented Jan 1, 2023

Ok, it builds ok on GitPod 🎉

I's a fair bit bigger though, half the size again:

gitpod /workspace/MultiQC (dockerfile-update) $ docker image ls
REPOSITORY      TAG       IMAGE ID       CREATED          SIZE
multiqc/new     latest    c07c030d8fe4   24 seconds ago   336MB
ewels/multiqc   latest    6444a526efaa   3 months ago     204MB

Would be nice to try to trim it down a little more, though it's not super important.

It would be cool to set up automated multi-arch builds! This blog post makes it sound very doable..

@ewels
Copy link
Member

ewels commented Jan 1, 2023

It would also be nice to use a multi-stage build instead of the huge chained run commands.

@ewels
Copy link
Member

ewels commented Jan 1, 2023

ok, I messed around with a few ideas and ended up with #1836 which uses one of the official Python base images.

This still ends up bigger than the existing image, but by a smaller margin:

gitpod /workspace/MultiQC (dockerfile_python_base) $ docker image ls
REPOSITORY      TAG           IMAGE ID       CREATED         SIZE
ewels/multiqc   python-slim   ce6cc07ddaf2   7 minutes ago   277MB
ewels/multiqc   latest        6444a526efaa   3 months ago    204MB

I think I prefer this as going directly from Python feels a bit simpler and hopefully more robust. It's still a multi-arch base image, so can hopefully still set up multi-arch MultiQC images.

What do you think @alexiswl?

@alexiswl
Copy link
Contributor Author

alexiswl commented Jan 2, 2023

This looks great!

@ewels ewels merged commit a4a3d6d into MultiQC:master Jan 2, 2023
@ewels
Copy link
Member

ewels commented Jan 3, 2023

Multi-arch effort started in #1837

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.

2 participants