-
Notifications
You must be signed in to change notification settings - Fork 164
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 VTPM container size #4324
Conversation
32d7f61
to
2d3d4c3
Compare
pkg/vtpm/Dockerfile
Outdated
@@ -19,6 +19,7 @@ RUN ./autogen.sh --prefix=/usr --with-tpm2 | |||
RUN make -j$(nproc) | |||
RUN make -j$(nproc) install | |||
RUN cp /usr/lib/libtpms.so.* /out/usr/lib/ | |||
RUN strip /out/usr/lib/libtpms.so.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUN strip /out/usr/lib/libtpms.so.* | |
RUN strip --strip-unneeded /out/usr/lib/libtpms.so.* |
as of https://www.linuxfromscratch.org/lfs/view/development/chapter08/stripping.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@christoph-zededa this is a default behavior but I'll commit it to be on a safe side
- strip SO libraries - do not copy *.a and *.la static libraries - fix ENV syntax to match the latest Dockerfile spec Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
2d3d4c3
to
d48fa29
Compare
LGTM, even though it should not affect anything, but let me run aziot tests and make sure everything remains functional. |
Tested the following :
all green. |
@shjala could you approve the PR then? |
We can do
here: Line 65 in d48fa29
as well I guess? |
@@ -47,6 +50,7 @@ RUN ./bootstrap && \ | |||
make -j$(nproc) | |||
RUN cp lib/.libs/libcommon.so* /out/usr/lib/ | |||
RUN cp tools/.libs/tpm2 /out/usr/bin/ | |||
RUN strip --strip-unneeded /out/usr/lib/*.so* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we strip the tmp2 bin as well here?
RUN strip --strip-unneeded /out/usr/lib/*.so* | |
RUN strip --strip-unneeded /out/usr/lib/*.so* | |
RUN strip --strip-unneeded /out/usr/bin/tpm2 |
The size of resulting rootfs image is reduced by
2 555 904
bytes (1%)