-
Notifications
You must be signed in to change notification settings - Fork 200
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
Bazel: support tar driver for oci_image
#461
Comments
Workaround: use oci_image(
name = "job_list_image",
base = "@python_base",
cmd = ["/job_list"],
tars = [":job_list_tar"],
workdir = "/job_list.runfiles/_main", # workaround for https://github.com/bazelbuild/rules_pkg/issues/813
)
oci_tarball(
name = "job_list_image_tar",
image = ":job_list_image",
repo_tags = ["job_list:local-dev"],
)
container_structure_test(
name = "job_list_image_test",
size = "small",
configs = ["job_list_image_test.yaml"],
driver = "tar",
image = ":job_list_image",
) |
I think it boils down to OCI layouts not being supported 🤔 related feature request: #305 |
+1 |
this works pretty good (https://github.com/bazel-contrib/rules_oci/blob/main/docs/load.md#build-outputs) oci_load(
name = "earth_auth_service_image_linux_amd64_tarball",
image = ":earth_auth_service_image_linux_amd64",
repo_tags = ["latest"],
)
filegroup(
name = "earth_auth_service_image_linux_amd64_tarball_tar",
srcs = [":earth_auth_service_image_linux_amd64_tarball"],
output_group = "tarball",
)
container_structure_test(
name = "earth_auth_service_image_linux_amd64_test",
configs = [":container_structure_test.yaml"],
image = ":earth_auth_service_image_linux_amd64_tarball_tar",
driver = "tar",
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure if this is a bug or FR, but the documentation is at least a tiny bit contradicting. From the docu, I would expect that the only limitation I get when using the
tar
driver is the missing support forcommandTests
. See this section:The example in that same section shows how it works providing a
image:tag
(not a*.tar
file!)container-structure-test test --driver tar --image gcr.io/registry/image:latest --config config.yaml
When using the
tar
driver in bazelit fails with
Error in fail: when the 'driver' attribute is not 'docker', then the image must be a .tar file
SOURCESo is this a real limitation? The tool itself apparently is happy to consume
image:tag
combos 🤔If so, what is the canonical way to use the
tar
driver withrules_oci
?The text was updated successfully, but these errors were encountered: