-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fixup #2
base: od-dockerize-nextjs
Are you sure you want to change the base?
Fixup #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,16 +82,57 @@ build_test( | |
], | ||
) | ||
|
||
platform( | ||
name = "linux_amd64", | ||
constraint_values = [ | ||
"@platforms//os:linux", | ||
"@platforms//cpu:x86_64", | ||
], | ||
) | ||
|
||
platform( | ||
name = "linux_arm64", | ||
constraint_values = [ | ||
"@platforms//os:linux", | ||
"@platforms//cpu:arm64", | ||
], | ||
) | ||
|
||
next_bin.next_binary( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of a |
||
name = "next_js_start", | ||
fixed_args = ["start"], | ||
chdir = package_name(), | ||
data = [ | ||
"//next.js/pages", | ||
"//next.js/public", | ||
"//next.js/styles", | ||
":next", | ||
"next.config.js", | ||
"package.json", | ||
":node_modules/@bazel-example/one", | ||
":node_modules/is-even", | ||
":node_modules/next", | ||
":node_modules/react", | ||
":node_modules/react-dom", | ||
":node_modules/typescript", | ||
], | ||
) | ||
|
||
js_image_layer( | ||
name = "layers", | ||
binary = ":next_start", | ||
binary = ":next_js_start", | ||
platform = select({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For transitioning the target platform to linux for for the container runtime so the image can be built locally on a mac |
||
"@platforms//cpu:arm64": ":linux_arm64", | ||
"@platforms//cpu:x86_64": ":linux_amd64", | ||
}), | ||
root = "/app", | ||
) | ||
|
||
oci_image( | ||
name = "image", | ||
base = "@debian_node", | ||
cmd = ["/app/next.js/next_start"], | ||
cmd = ["/app/next.js/next_js_start"], | ||
workdir = "/app/next.js/next_js_start.runfiles/_main", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
entrypoint = ["/bin/bash"], | ||
tars = [ | ||
":layers", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed on MacOS under bzlmod to run
WORKSPACE does not have this issue on transitions