Skip to content
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

Adding non-root user in jammy issues results in image size increase #4588

Closed
lbussell opened this issue May 2, 2023 · 3 comments
Closed

Comments

@lbussell
Copy link
Contributor

lbussell commented May 2, 2023

See #4587. I investigated the difference between the two images:

  • mcr.microsoft.com/dotnet/nightly/runtime-deps@sha256:24cc8445fa87fb3771d40628f6745b3988f425dcd3d6fb80a2384305ae7c536e (new)
  • mcr.microsoft.com/dotnet/nightly/runtime-deps@sha256:1dd42bff18ccd210bea44f481ee3b49db9cea509e7b7ff2a2e2b3e5aff3a1ac3 (old)

The culprit here is the /var/log/lastlog file. It has increased in size from 30kb to 19mb. /var/log/faillog has also increased in size from 3.3kb to 2.1mb. This requires some more investigation.

@lbussell lbussell changed the title Adding non-root user in jammy issues results in size increase Adding non-root user in jammy issues results in image size increase May 2, 2023
@mthalman
Copy link
Member

mthalman commented May 3, 2023

In general, we should probably be cleaning up log files, especially those of this size.

@lbussell
Copy link
Contributor Author

lbussell commented May 3, 2023

So this actually happens because of #4476. /var/lib/lastlog stores user login data indexed by UID. So when we increased the UID we inadvertently made this file really big. The solution is to run adduser with the -l option which omits these log files. PR incoming for that.

@lbussell
Copy link
Contributor Author

This particular /var/lib/lastlog issue is fixed with #4593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants