Skip to content

feat(na): cache docker image to make booting quicker#2170

Closed
mrjones-plip wants to merge 3 commits intomainfrom
cache-docker-image
Closed

feat(na): cache docker image to make booting quicker#2170
mrjones-plip wants to merge 3 commits intomainfrom
cache-docker-image

Conversation

@mrjones-plip
Copy link
Copy Markdown
Contributor

@mrjones-plip mrjones-plip commented Mar 25, 2026

Description

This PR adds a Dockerfile that runs the apk add commands that we used to run every time you booted up the docker service. By caching this install command, the boot up time, and specifically the time to be able to start serving HTTP requests, is a lot less. This is especially true when developers (like me!) use docker rm -f $(docker ps -qa) to frequently cull all running services.

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@mrjones-plip mrjones-plip requested a review from jkuester March 25, 2026 20:58
@mrjones-plip
Copy link
Copy Markdown
Contributor Author

Maybe there's some other optimizations, but I'm rescinding this PR as the speed gain is nominal at best. Here's timings of running docker rm -f $(docker ps -qa) && docker compose up and waiting until I see:

cht-hugo  | Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
cht-hugo  | Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) 
cht-hugo  | Press Ctrl+C to stop
main branch
7.14 6.71
7.06 6.39
9.61 6.31
8.41 10.24
7.05 6.48

Even changing the entry point from ENTRYPOINT ["hugo", "server", "--buildDrafts", "--buildFuture", "--bind", "0.0.0.0"] to ENTRYPOINT ["hugo", "server"] didn't seem to make a difference

🤷

@mrjones-plip
Copy link
Copy Markdown
Contributor Author

Good news everybody! The version we're about to ship in #2152 seems to reduce compile time by ~1sec 😅

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.

1 participant