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

[docker] About 60% docker image size reduce (1.2GB -->> 480MB) #2129

Merged
merged 2 commits into from May 18, 2021
Merged

[docker] About 60% docker image size reduce (1.2GB -->> 480MB) #2129

merged 2 commits into from May 18, 2021

Conversation

ymping
Copy link

@ymping ymping commented May 18, 2021

Recently, I am using hue in my company production environment. At the beginning, i used the official docker image pull from docker hub, but Clickhouse query not work, missing something python package. so i try to build from source code and install the missing python package. when i clone the repo and get the Dockerfile, there are many improvements can do as a professional devops engineer, so just do it.

What changes were proposed in this pull request?

  1. merge docker build step to reduce docker image layer
  2. apt and pip install without cache storage
  3. directory desktop/core/ext-py/ add to docker layer but delete it at Dockerfile, so add it to .dockerignore
  4. node.js 10.x is no longer actively supported! upgrade to 14
  5. FIX comment issue at Dockerfile L74: "threadloop # Needed for Jaeger ", this make pip explain the follow line as comment
  6. FIX Clickhouse "Can't load plugin: sqlalchemy.dialects:clickhouse" by pip install sqlalchemy-clickhouse

How was this patch tested?

  • Tested this patch manaual. I build the docker images and push to k8s cluster, everything go well.

ymping and others added 2 commits May 18, 2021 15:24
…B, compressed status)

1, merge docker build step to reduce docker image layer
2, apt and pip install without cache storage
3, directory desktop/core/ext-py/ add to docker layer but delete it at Dockerfile, so add it to .dockerignore
4, node.js 10.x is no longer actively supported! upgrade to 14
5, FIX comment issue at Dockerfile L74: "threadloop  # Needed for Jaeger \", this make pip explain the follow line as comment
6, FIX Clickhouse "Can't load plugin: sqlalchemy.dialects:clickhouse" by pip install sqlalchemy-clickhouse
@ymping ymping changed the title [docker] About 60% docker image size reduce (1.2GB -->> 480M) [docker] About 60% docker image size reduce (1.2GB -->> 480MB) May 18, 2021
@romainr
Copy link
Contributor

romainr commented May 18, 2021

This looks great!
Node was changed to 14 recently too. At some point we will switch to mutli stage build so that we can still have separate cached layers and even less install leaks. Fine to add clickhouse sql-alchemy as popular and you already saved a lot of size.

@romainr romainr enabled auto-merge (rebase) May 18, 2021 12:59
@romainr romainr merged commit cedf316 into cloudera:master May 18, 2021
@romainr
Copy link
Contributor

romainr commented May 18, 2021

And already live on https://demo.gethue.com/

docker-image-60

@romainr
Copy link
Contributor

romainr commented May 20, 2021

One follow-up #2141

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.

None yet

2 participants