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

Reduce the docker image #153

Open
sunilsankar opened this issue Jul 28, 2023 · 4 comments
Open

Reduce the docker image #153

sunilsankar opened this issue Jul 28, 2023 · 4 comments
Labels
enhancement New feature or request waha:PLUS Relates to WAHA Plus version

Comments

@sunilsankar
Copy link
Contributor

Hi is it possible to reduce the docker image size. I see that it is 1.92GB for arm .Can we use alpine image instead of bullseye and also reducing the number of layers make the image small.
Better to have different images for noweb and webjs. Just a suggestion . Awesome project btw :)

REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE
devlikeapro/whatsapp-http-api   arm       40ff15031379   11 days ago   1.92GB
@allburov allburov added enhancement New feature or request waha:PLUS Relates to WAHA Plus version labels Aug 1, 2023
@ksingh7
Copy link

ksingh7 commented Aug 2, 2023

+1 @sunilsankar @allburov
Using scratch or alpine + using docker-slim to further squeeze the image size.

@allburov
Copy link
Contributor

allburov commented Aug 6, 2023

Hi!
Great idea, I'm facing the problem with the image size while using 3G mobile internet :D

I'd love to keep the original and latest image as debian based and "all inclusive" tho.
For the start we could create these images (it'll reduce about 500MB memory that chromium uses)

  • devlikepro/whatsapp-http-api:latest - Debian, all installed
  • devlikepro/whatsapp-http-api:slim - Debian, no chromium
  • devlikepro/whatsapp-http-api:arm - Debian ARM, all installed
  • devlikepro/whatsapp-http-api:arm-slim - debian ARM, all installed

In the next step we could try to use alpine (I'm skeptical about docker-slim...) and create a bit more images

  • devlikepro/whatsapp-http-api:alpine - Debian, all installed
  • devlikepro/whatsapp-http-api:alpine-slim - alpine, no chromium
  • devlikepro/whatsapp-http-api:arm-alpine - alpine ARM, all installed
  • devlikepro/whatsapp-http-api:arm-alpine-slim - debian ARM, all installed

8 images... If there's anyone who could contribute to the project so we can have 2 Dockerfiles for that Dockerfile and Dockerfile.alpine - it'd be great 🙏

I'd start with the first step - separating chrome\no-chrome builds
For "with chromium" and "no chromium" we could use multi stage builds so we don't have to maintain 4 Dockerfiles and keep them in sync...

@sunilsankar
Copy link
Contributor Author

I will try to contribute @allburov

@allburov
Copy link
Contributor

allburov commented Nov 5, 2023

Hi!
I've added 3 different images - default with chromium, with chrome and no browser (for NOWEB engine)
https://waha.devlike.pro/docs/how-to/engines/#docker-images

devlikeapro/whatsapp-http-api                                  noweb              1.49GB
devlikeapro/whatsapp-http-api                                  chrome             2GB
devlikeapro/whatsapp-http-api                                  latest             2.05GB

It shouldn't be hard to extend it with alpine or similar small base image using github matrix https://github.com/devlikeapro/whatsapp-http-api/blob/core/.github/workflows/build.yaml

The tags should be start with alpine in this way

  • alpine-latest
  • alpine-chrome
  • alpine-noweb-arm (no chrome available for arm)

Contributions are welcome!

@allburov allburov added dependencies Pull requests that update a dependency file and removed dependencies Pull requests that update a dependency file labels Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request waha:PLUS Relates to WAHA Plus version
Projects
None yet
Development

No branches or pull requests

3 participants