Azure / Azure/static-web-apps

Provide a slimmer docker image to reduce deployment time

Open
#878 10 comments 6 reactions 0 assignees View on GitHub
enhancement oryx
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
The Azure static web app deployment relies on pulling a 1.98GB docker image from `mcr.microsoft.com/appsvc/staticappsclient:stable`. This image takes roughly 40s to download on a GitHub-hosted runner. As a result, many deployments of static web apps take >1m in total time (assuming changes to the static content are relatively minimal). Since GitHub actions billing rounds up to the nearest minute, many of these deployments cost 2m of billable time. If a smaller image was provided, then deployments into static web apps should take less than a minute on average, and therefore halve the cost of billable action minutes, a significant savings.

I also would make a safe bet that the image contains a lot of unnecessary binaries. Minimizing this image would reduce security attack surface area and also reduce bandwidth and storage costs for serving the image.

**Describe the solution you'd like**
The `staticappsclient` image is based on a Debian `stretch` base image. I created my own image using `stretch-slim` as a base, copied over Oryx and StaticSiteClient binaries from the official image, and ended up with a working image 281MB in size. This is over a 85% reduction in size. This image takes less than 10s to download on a GitHub-hosted runner compared to 40s for the official image.

I believe an official image can be made that is in the same ballpark in size and published as the new `mcr.microsoft.com/appsvc/staticappsclient:stable` image.

**Describe alternatives you've considered**
You could look at alternative ways of serving this image faster, perhaps using caching within GitHub. I was not able to use any of the GitHub action caching features to make this any faster than downloading directly from MCR. The only way I could significantly optimize the deployment time was to reduce the size of the image.

**Additional context**
None

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.