GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add --no-log-init to the node user that gets created to avoid massive image sizes · Issue #1779 · nodejs/docker-node

Add --no-log-init to the node user that gets created to avoid massive image sizes #1779

New issue
Copy link
New issue
Copy link
Open
Feature
Open
Add --no-log-init to the node user that gets created to avoid massive image sizes#1779
Feature
Copy link

Description

@nickjj
nickjj
opened on Oct 4, 2022
Issue body actions

Problem

Currently the node user is created with useradd --uid 1000 --gid node --shell /bin/bash --create-home node.

When customizing the UID / GID using build args with groupmod -g "${GID}" node && usermod -u "${UID}" -g "${GID}" node, some folks are reporting they are running out of disk space and can't build the image when they have a non-1000 UID on systems that create a lot of users.

Here's a comment going into more detail: nickjj/docker-flask-example#7 (comment)

Also not using --no-log-init will cause Hadolint to throw this warning: -:44 DL3046 warning: useradd without flag -l and high UID will result in excessively large Image.

The usermod command doesn't support being able to set that option so it means our only option is to delete the node user and create a new one in which case life could be simplified by setting that flag here. You could make a case this is a bug report and not feature request due to the implications of not setting this flag when you create users in a Docker image.

Solution

Add --no-log-init to all of the useradd commands that create the node user.

Activity

  1. MikeMcC399 commented on May 3, 2026

    @MikeMcC399
    MikeMcC399
    on May 3, 2026
    Contributor
    More actions

    It seems like https://github.com/hadolint/hadolint/wiki/DL3046 makes a good case for adding --no-log-init to the Debian build templates.

    Disabling this functionality from useradd has minimal disadvantages in a container but saves space and build time.

    https://manpages.debian.org/trixie/passwd/useradd.8.en.html

    -l, --no-log-init

    Do not add the user to the lastlog and faillog databases.
    By default, the user's entries in the lastlog and faillog databases are reset to avoid reusing the entry from a previously deleted user.

  2. MikeMcC399
    added the
    Feature
    issue type on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.