Skip to content

Commit

Permalink
feat: split js_image_layer into 5 layers
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed May 9, 2024
1 parent ccc9fe3 commit a1823d0
Show file tree
Hide file tree
Showing 21 changed files with 755 additions and 184 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Input hashes for repository rule npm_translate_lock(name = "npm", pnpm_lock = "@@//:pnpm-lock.yaml").
# This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=-2065072158
pnpm-lock.yaml=1142601305
pnpm-lock.yaml=-481966245
examples/npm_deps/patches/meaning-of-life@1.0.0-pnpm.patch=-442666336
package.json=-275319675
pnpm-workspace.yaml=-1178830835
Expand All @@ -23,5 +23,5 @@ npm/private/test/vendored/semver-max/package.json=578664053
examples/linked_empty_node_modules/package.json=-1039372825
examples/npm_package/packages/pkg_d/package.json=1110895851
js/private/image/package.json=-1260474848
js/private/test/image/package.json=1286417612
js/private/test/image/package.json=-687546763
js/private/test/js_run_devserver/package.json=-260856079
92 changes: 81 additions & 11 deletions docs/js_image_layer.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 29 additions & 5 deletions e2e/js_image_docker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,25 @@ js_image_layer(
)

filegroup(
name = "app_tar",
name = "node_tar",
srcs = [":layers"],
output_group = "app",
output_group = "node",
)

container_layer(
name = "app_layer",
tars = [":app_tar"],
name = "node_layer",
tars = [":node_tar"],
)

filegroup(
name = "package_store_3p_tar",
srcs = [":layers"],
output_group = "package_store_3p",
)

container_layer(
name = "package_store_3p_layer",
tars = [":package_store_3p_tar"],
)

filegroup(
Expand All @@ -68,6 +79,17 @@ container_layer(
tars = [":node_modules_tar"],
)

filegroup(
name = "app_tar",
srcs = [":layers"],
output_group = "app",
)

container_layer(
name = "app_layer",
tars = [":app_tar"],
)

container_image(
name = "image",
architecture = "amd64", # or arm64
Expand All @@ -77,8 +99,10 @@ container_image(
cmd = ["/app/bin"],
entrypoint = ["bash"],
layers = [
":app_layer",
":node_layer",
":package_store_3p_layer",
":node_modules_layer",
":app_layer",
],
# This is `cmd` + `.runfiles/[workspace name]`
workdir = select({
Expand Down
Loading

0 comments on commit a1823d0

Please sign in to comment.