Skip to content

Commit

Permalink
Add terraform:0.13.0 image
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienPatte committed Nov 5, 2020
1 parent 7d98dce commit d6400ea
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bazel-*
Empty file added BUILD.bazel
Empty file.
35 changes: 35 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_docker",
sha256 = "1698624e878b0607052ae6131aa216d45ebb63871ec497f26c67455b34119c80",
strip_prefix = "rules_docker-0.15.0",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.15.0/rules_docker-v0.15.0.tar.gz"],
)

load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)

container_repositories()

load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")

container_deps()

load("@io_bazel_rules_docker//container:container.bzl", "container_pull")

container_pull(
name = "distroless",
digest = "sha256:f2d2b4f3b53f952d74148ad1242f3d36904598b33cd6411ee886088e0744270e",
registry = "gcr.io",
repository = "distroless/static-debian10",
)

http_archive(
name = "terraform_0.13.0_linux_amd64",
build_file_content = "exports_files([\"terraform\"])",
sha256 = "9ed437560faf084c18716e289ea712c784a514bdd7f2796549c735d439dbe378",
urls = ["https://releases.hashicorp.com/terraform/0.13.0/terraform_0.13.0_linux_amd64.zip"],
)
21 changes: 21 additions & 0 deletions terraform/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push")

container_image(
name = "0.13.0",
base = "@distroless//image",
cmd = "help",
directory = "/bin/",
entrypoint = ["/bin/terraform"],
files = ["@terraform_0.13.0_linux_amd64//:terraform"],
mode = "0o755",
repository = "quay.io/hadrienpatte",
)

container_push(
name = "0.13.0_push",
format = "Docker",
image = ":0.13.0",
registry = "quay.io",
repository = "hadrienpatte/{}".format(package_name()),
tag = "0.13.0",
)

0 comments on commit d6400ea

Please sign in to comment.