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

@wordpress/env start command creates images that are > 100GB. #50934

Closed
horsemanV opened this issue May 24, 2023 · 1 comment · Fixed by #51034
Closed

@wordpress/env start command creates images that are > 100GB. #50934

horsemanV opened this issue May 24, 2023 · 1 comment · Fixed by #51034
Assignees
Labels
[Package] Env /packages/env

Comments

@horsemanV
Copy link

Description

@wordpress/env start is occasionally failing, and generating very large Docker images in the process.

I've attached the output of running npx @wordpress/env@latest start, which shows the process failing due to errors while building the images (see screenshots section below).

As far as I can tell these ballooning image sizes are due to this line in gutenberg/packages/env/lib/init-config.js.

Refer to these two issues from StackOverflow, where running useradd without the -l or --no-log-init flags inside of a Dockerfile caused ballooning image sizes.

Step-by-step reproduction instructions

  1. Create a new block for testing
npx @wordpress/create-block --wp-env --wp-scripts --namespace repro --title DockerImageSize --category text docker-image-size
  1. Inside the newly created block's directory run npm run env start -- --debug
  2. Wait until the command either succeeds or times out.
  3. Inspect the sizes of the resulting images, either by running
docker images "$(basename $(npm run env install-path 2>&1 | sed -n '5,5p'))*-wordpress"

or by inspecting them in the Docker Dashboard under the Images section.

Screenshots, screen recording, code snippet

Results from running npx @wordpress/env@latest start inside a freshly created block.

Image Sizes via Docker CLI

Image Sizes CLI

Image Sizes via Docker Dashboard

Image Sizes

Environment info

OS / Tooling

macOS: Ventura 13.3.1 (a)
node: v16.19.0
npm: 8.19.3
docker: version 23.0.5, build bc4487a
docker-compose: version v2.17.3

WordPress NPM Packages

@wordpress/create-block 3.6.0
@wordpress/env: 7.0.0
@wordpress/scripts: 26.4.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@horsemanV
Copy link
Author

As a follow-up (and because v8.0.0 was released while I was opening this issue), I have run through the same process again using @wordpress/env@8.0.0 and the results are the same (see screenshot below).

8 0 0-CLI-Image-Size
@t-hamano t-hamano added the [Package] Env /packages/env label May 25, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label May 27, 2023
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Env /packages/env
4 participants