Skip to content

Commit

Permalink
Reduce image size
Browse files Browse the repository at this point in the history
  • Loading branch information
artnc committed May 17, 2024
1 parent a65c7a1 commit 2245b4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,12 @@ RUN tsc \
&& mv entry.js entry \
&& chmod +x entry \
&& touch /emptyfile

# Delete unused files (found by running `apk add ncdu && ncdu` inside `make
# shell`) to reduce the prebuilt image's size
RUN rm -rf \
/root/.cache \
/root/.npm \
/usr/bin/lto-dump \
/usr/local/lib/node_modules/@types \
/usr/local/lib/node_modules/typescript
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ push: test
docker buildx inspect | grep -q docker-container || docker buildx create --use
# https://stackoverflow.com/a/69987949
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx build --push --platform linux/amd64,linux/arm64 \
docker buildx build --push --platform linux/amd64,linux/arm64 --squash \
-t "$(_IMAGE_NAME):$$(git tag | tail -1)" \
-t "$(_IMAGE_NAME):latest" \
.
Expand Down

0 comments on commit 2245b4c

Please sign in to comment.