git_repository(
name = "io_bazel_rules_python",
remote = "https://github.com/bazelbuild/rules_python.git",
commit = "979fca9ac17ffdb5f715854d6100f7d29dd17875",
)
load("@io_bazel_rules_python//python:pip.bzl", "pip_repositories", "pip_import")
pip_repositories()
pip_import(
name = "piptool_deps",
requirements = "@io_bazel_rules_python//python:requirements.txt",
)
load(
"@piptool_deps//:requirements.bzl",
_piptool_install = "pip_install",
)
_piptool_install()
pip_import(
name = "aws",
requirements = "//:requirements.txt",
)
load(
"@aws//:requirements.bzl",
_aws_install = "pip_install",
)
_aws_install()
My top level requirements.txt is:
awscli>=1.11.183
Im Building a docker images that looks like this in the BUILD file:
oad("@aws//:requirements.bzl", "requirement")
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_image",
"container_push",
)
load("@distroless//package_manager:package_manager.bzl", "dpkg_list")
load("@package_bundle//file:packages.bzl", "packages")
container_image(
name = "build_image",
base = "@stretch//image",
debs = [
packages["zlib1g"],
packages["openjdk-8-jre-headless"],
packages["python2.7-minimal"],
packages["libpython2.7-minimal"],
packages["libpython2.7-stdlib"],
packages["git"],
],
files = [
requirement("awscli")
],
symlinks = {
"/usr/bin/java": "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java",
"/usr/bin/python": "/usr/bin/python2.7",
},
cmd = ["cat"]
)
As you can see, I have no idea where/how to install the awscli package. When I run the resulting container of the above, I see that the awscli pacakge has been expanded in the top level of the container.
Any insight or help would be greatly appreciated. I am loving the Bazel build tool so far.
Thank you
files = [requirement("awscli")],
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/b3764535-2d9d-41d8-a491-55f3d6a86fdf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I will look into subpar. I made efforts into the py_image bazel rule and I believe that's the direction I'd like to go, It appears that using py_image would allow me to place the awscli dependency on it's own layer of the docker image? That would be great since it will rarely change and the image builds should be faster.
Thanks again.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/cdf1e3f4-9b3c-4573-a6d6-105a30799bbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/b3764535-2d9d-41d8-a491-55f3d6a86fdf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.