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 Docker image size. resolves #269 #270

Closed
wants to merge 2 commits into from

Conversation

ngosang
Copy link
Contributor

@ngosang ngosang commented Aug 29, 2021

Size (uncompressed): Previous 573.1 MB / This PR 225.8 MB
Container startup time is faster. Ansible and chown were slow
Build time is 3 times faster. Less packages and TAR download
No changes required by the user. Same env vars, same paths, same core packages ...

  • Update Alpine 3.16. gnu-libiconv is already fixed in this version
  • Update PHP 8
  • Remove heavy packages: ansible, git, make, bash ...
  • Download Wallabag TAR. Is faster and git is not required
  • Replace environment variables with envsubst
  • Reorder steps to build faster and reduce image size

@ngosang
Copy link
Contributor Author

ngosang commented Aug 29, 2021

I'm using this in Production in combination with #265
I don't know how to test import and migration tasks. They should work but maybe it's neccessary to install bash and make. They are commented in the PR for that reason.

@ngosang ngosang force-pushed the docker_size branch 2 times, most recently from cc8e5ab to 623ed59 Compare August 29, 2021 14:20
@luckydonald
Copy link

Is this already available on docker hub somewhere?

@ngosang
Copy link
Contributor Author

ngosang commented Dec 17, 2021

Is this already available on docker hub somewhere?

No sorry, but you can download the PR and build the image in your server:
docker build -t wallabag:custom .

Size (uncompressed): Previous 573.1 MB  /  This PR 225.8 MB
Container startup time is faster. Ansible and chown where slow
Build time is 3 times faster. Less packages and TAR download
No changes required by the user. Same env vars, same paths, same core packages ...

* Update Alpine 3.14. gnu-libiconv is already fixed in this version
* Remove heavy packages: ansible, git, make, bash ...
* Download Wallabag TAR. Is faster and git is not required
* Replace environment variables with envsubst
* Reorder steps to build faster and reduce image size
@ngosang
Copy link
Contributor Author

ngosang commented Jul 27, 2022

I don't know if anyone is using this image but me. I just pushed a commit with Wallabag 2.5.1 + Alpine 3.16 + PHP 8

@ngosang
Copy link
Contributor Author

ngosang commented Oct 25, 2022

@j0k3r @Kdecherf I'm using a custom Docker image but I'm interested in merge upstream. If you are willing to merge I can split this PR into smaller PRs. Also tell me if some changes in this PR are not going to be accepted (like using PHP 8)

The PRs could be something like:

  • Update PHP 8
  • Remove bash
  • Remove git
  • Clean cache files
  • Reorder build layers
  • ...

@ngosang
Copy link
Contributor Author

ngosang commented Oct 29, 2022

Already fixed in other PRs

@ngosang ngosang closed this Oct 29, 2022
@ngosang ngosang deleted the docker_size branch October 29, 2022 00:42
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