Skip to content

Commit

Permalink
chore: optimize tools image size
Browse files Browse the repository at this point in the history
Drop stuff we don't need in the final image.

Before:

```
4.0K	./var
32K	./doc
252K	./etc
2.2M	./sbin
3.6M	./man
4.2M	./x86_64-linux-musl
36M	./include
98M	./libexec
138M	./share
163M	./bin
262M	./lib
263M	./go
969M	.
```

After:

```
4.0K	./var
32K	./doc
252K	./etc
2.2M	./sbin
3.6M	./man
4.2M	./x86_64-linux-musl
36M	./include
61M	./share
98M	./libexec
163M	./bin
239M	./go
262M	./lib
867M	.
```

So -100M (uncompressed).

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Jul 20, 2023
1 parent dc7dd9e commit 7cefce4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gnutls/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ steps:
build:
- |
make DESTDIR=/rootfs
make -j $(nproc) DESTDIR=/rootfs
install:
- |
make DESTDIR=/rootfs install
Expand Down
1 change: 1 addition & 0 deletions golang/golang/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ steps:

prepare:
- tar -xzf go.src.tar.gz --strip-components=1
- rm go.src.tar.gz

build:
- cd src && sh make.bash
Expand Down
3 changes: 3 additions & 0 deletions tools/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ steps:
- prepare:
- |
cp /pkg/files/adjust.sh ${TOOLCHAIN}/bin
- |
# clean up some files we don't ever need
rm -rf ${TOOLCHAIN}/man ${TOOLCHAIN}/share/doc ${TOOLCHAIN}/share/info ${TOOLCHAIN}/share/locale ${TOOLCHAIN}/share/man
finalize:
- from: /toolchain
to: /toolchain

0 comments on commit 7cefce4

Please sign in to comment.