bazel-contrib / rules_oci

Bazel rules for building OCI containers
Apache License 2.0
305 stars 159 forks source link

How do I install awk into distroless? Do I make a symlink in my OCI image? #729

Closed blockjon-dd closed 4 weeks ago

blockjon-dd commented 4 weeks ago

I'm trying to install awk and it seems like my options are to install gawk or mawk. When I use rules_oci to do that, the command awk is not found in the resulting image.

Do I need to create a symlink (awk->gawk)? If so, how do I create a symlink using rules_oci? Maybe there's another way to do this?

blockjon-dd commented 4 weeks ago

Answering my own question:

pkg_tar(
    name="mysymlink",
    symlinks = { "/usr/bin/awk": "/usr/bin/gawk"},
)

something like this seems to work.