You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a web server written in Go. I have a folder of html template files as data dependencies in a go_library target, i.e.
file_group = (
name = "my_templates",
srcs = ["path/to/my/.html"],
)
go_library = (
...
data = [":my_templates"]
)
I am currently using rules_docker which correctly preserves the folder structure of runfiles that my Go code relies to serve the html templates.
Since rules_docker is now deprecated I am trying to migrate to rule_oci and thus pkg_tar in rules_pkg.
The problem
With pkg_tar, the data dependencies no longer reside in the same folder as layered out by bazel build. Instead every file is flatten into the root directory.
I thought v0.10.0 would solve the problem judging from #579. But seems like it only does so for Python?
For my Go project setup,
go_library(
name = "server_lib",
srcs = ["main.go"],
...
)
go_binary(
name = "server",
embed = [":server_lib"],
...
)
pkg_tar(
name = "server-tar",
srcs = [":server"],
include_runfiles = True,
)
oci_image(
name = "server-image",
base = "@distroless_base",
entrypoint = ["/server"],
tars = [":server-tar"],
)
After bazel build :server the runfiles lie in bazel-bin/server_/server.runfiles/_main/.
#579 (comment) describes exactly what rules_docker does and what I need.
The text was updated successfully, but these errors were encountered:
Context
I have a web server written in Go. I have a folder of html template files as data dependencies in a
go_library
target, i.e.I am currently using
rules_docker
which correctly preserves the folder structure of runfiles that my Go code relies to serve the html templates.Since
rules_docker
is now deprecated I am trying to migrate torule_oci
and thuspkg_tar
inrules_pkg
.The problem
With
pkg_tar
, the data dependencies no longer reside in the same folder as layered out bybazel build
. Instead every file is flatten into the root directory.I thought
v0.10.0
would solve the problem judging from #579. But seems like it only does so for Python?For my Go project setup,
After
bazel build :server
the runfiles lie inbazel-bin/server_/server.runfiles/_main/
.#579 (comment) describes exactly what rules_docker does and what I need.
The text was updated successfully, but these errors were encountered: