Skip to content

Commit

Permalink
Fixed Docker Image Size Ballooning (#51034)
Browse files Browse the repository at this point in the history
When running `useradd` without the `-l` option it can
cause certain log files to reach absurd file sizes. This
option avoids writing anything to these logs.
  • Loading branch information
ObliviousHarmony authored May 30, 2023
1 parent 43f6e60 commit 6a06d08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/env/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Execute the local package's `wp-env` instead of the globally installed version if one is available.

### Bug fix

- Run `useradd` with `-l` option to prevent excessive Docker image sizes.

## 8.0.0 (2023-05-24)

### Breaking Change
Expand Down
4 changes: 2 additions & 2 deletions packages/env/lib/init-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ ARG HOST_USERNAME
ARG HOST_UID
ARG HOST_GID
# When the IDs are already in use we can still safely move on.
RUN groupadd -g $HOST_GID $HOST_USERNAME || true
RUN useradd -m -u $HOST_UID -g $HOST_GID $HOST_USERNAME || true
RUN groupadd -o -g $HOST_GID $HOST_USERNAME || true
RUN useradd -mlo -u $HOST_UID -g $HOST_GID $HOST_USERNAME || true
# Install any dependencies we need in the container.
${ installDependencies( 'wordpress', env, config ) }`;
Expand Down

1 comment on commit 6a06d08

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 6a06d08.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5127208968
📝 Reported issues:

Please sign in to comment.