Skip to content

Remove development packages from Pulsar's docker images - #14093

Merged
merlimat merged 4 commits into
apache:masterfrom
lhotari:lh-remove-dev-packages
Feb 2, 2022
Merged

merlimat merged 4 commits into
apache:masterfrom
lhotari:lh-remove-dev-packages

Conversation

@lhotari

@lhotari lhotari commented Feb 2, 2022

Copy link
Copy Markdown
Member

Fixes #14092

Motivation

There's a lot of unnecessary tooling that gets installed in the Pulsar docker images.

Modifications

  • remove dev packages
  • use python3-pip package for installing pip

@lhotari lhotari added component/deploy doc-not-needed Your PR changes do not impact docs labels Feb 2, 2022
@lhotari lhotari self-assigned this Feb 2, 2022
@lhotari lhotari added this to the 2.10.0 milestone Feb 2, 2022
@lhotari
lhotari force-pushed the lh-remove-dev-packages branch from c4b64ee to f47b7cb Compare February 2, 2022 16:07

@michaeljmarshall michaeljmarshall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@michaeljmarshall

Copy link
Copy Markdown
Member

For reference, I was wondering why we had these dependencies in the first place. It looks like they were needed because at one point we were building python from source: #4754. We don't do that now, so we definitely don't need these dependencies.

@michaeljmarshall

Copy link
Copy Markdown
Member

Note that the RUN apt-get docker image layer is 1 gigabyte in 2.9.1. I am hopeful that this will help cut down on our docker image size.

Comment thread docker/pulsar/Dockerfile Resolved
@lhotari

lhotari commented Feb 2, 2022

Copy link
Copy Markdown
Member Author

@merlimat I pushed changes to omit installing GCC when python3-pip package gets installed. Let's see if the build and tests continue to pass.

@merlimat
merlimat merged commit 14a28d7 into apache:master Feb 2, 2022
@lhotari

lhotari commented Feb 3, 2022

Copy link
Copy Markdown
Member Author

Just adding a link to a blog post which explains the need to use --no-install-recommends when creating docker images: https://ubuntu.com/blog/we-reduced-our-docker-images-by-60-with-no-install-recommends

@lhotari
lhotari deleted the lh-remove-dev-packages branch February 3, 2022 07:08
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
* Remove development packages from Pulsar's docker images

* Add "--no-install-recommends" to skip installing GCC and lots of other tools

* Install ca-certificates

* Install build-essential for building pulsar-functions-go examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a smaller Pulsar docker image without unnecessary development packages

4 participants