This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 146
/
WORKSPACE
218 lines (183 loc) · 6.66 KB
/
WORKSPACE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Rules to run a command inside a container, and either commit the result
to new container image, or extract specified targets to a directory on
the host machine.
"""
workspace(name = "base_images_docker")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "bazel_skylib",
remote = "https://github.com/bazelbuild/bazel-skylib.git",
tag = "0.6.0",
)
# Docker rules.
http_archive(
name = "io_bazel_rules_docker",
sha256 = "9ff889216e28c918811b77999257d4ac001c26c1f7c7fb17a79bc28abf74182e",
strip_prefix = "rules_docker-0.10.1",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.10.1/rules_docker-v0.10.1.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",
)
git_repository(
name = "structure_test",
commit = "61f1d2f394e1fa1cd62f703cd51a8300e225da5a",
remote = "https://github.com/GoogleCloudPlatform/container-structure-test.git",
)
git_repository(
name = "runtimes_common",
commit = "9828ee5659320cebbfd8d34707c36648ca087888",
remote = "https://github.com/GoogleCloudPlatform/runtimes-common.git",
)
http_archive(
name = "docker_credential_gcr",
build_file_content = """package(default_visibility = ["//visibility:public"])
exports_files(["docker-credential-gcr"])""",
sha256 = "3f02de988d69dc9c8d242b02cc10d4beb6bab151e31d63cb6af09dd604f75fce",
type = "tar.gz",
url = "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v1.4.3/docker-credential-gcr_linux_amd64-1.4.3.tar.gz",
)
git_repository(
name = "subpar",
commit = "07ff5feb7c7b113eea593eb6ec50b51099cf0261",
remote = "https://github.com/google/subpar",
)
container_pull(
name = "debian_base",
digest = "sha256:00109fa40230a081f5ecffe0e814725042ff62a03e2d1eae0563f1f82eaeae9b",
registry = "gcr.io",
repository = "google-appengine/debian9",
)
# If you're trying to build this locally on a modern distro, switch distroless
# to a local_repository, clone it down to the specified path, and run
# bazel build //package_manager:dpkg_parser.par before building here.
git_repository(
name = "distroless",
commit = "a4fd5de337e31911aeee2ad5248284cebeb6a6f4",
remote = "https://github.com/GoogleContainerTools/distroless.git",
)
# If you're trying to build this locally on a modern distro, the load
# statement with package_manager.bzl and package_manager_repositories
# below must be removed after adjusting the distroless repo above.
load(
"@distroless//package_manager:package_manager.bzl",
"package_manager_repositories",
)
load(
"@distroless//package_manager:dpkg.bzl",
"dpkg_list",
"dpkg_src",
)
# If you're trying to build this locally on a modern distro, remove
# or comment out package_manager_repositories() below.
package_manager_repositories()
# The Debian snapshot datetime to use. See http://snapshot.debian.org/ for more information.
DEB_SNAPSHOT = "20190708T153325Z"
dpkg_src(
name = "debian_stretch",
arch = "amd64",
distro = "jessie",
sha256 = "7240a1c6ce11c3658d001261e77797818e610f7da6c2fb1f98a24fdbf4e8d84c",
snapshot = DEB_SNAPSHOT,
url = "http://snapshot.debian.org/archive",
)
# These are needed to install debootstrap.
dpkg_list(
name = "package_bundle",
packages = [
"ca-certificates",
"debootstrap",
"libffi6",
"libgmp10",
"libgnutls-deb0-28",
"libhogweed2",
"libicu52",
"libidn11",
"libnettle4",
"libp11-kit0",
"libpsl0",
"libtasn1-6",
"wget",
],
sources = [
"@debian_stretch//file:Packages.json",
],
)
http_archive(
name = "io_bazel_rules_go",
sha256 = "86ae934bd4c43b99893fc64be9d9fc684b81461581df7ea8fc291c816f5ee8c5",
urls = ["https://github.com/bazelbuild/rules_go/releases/download/0.18.3/rules_go-0.18.3.tar.gz"],
)
http_archive(
name = "bazel_gazelle",
sha256 = "3c681998538231a2d24d0c07ed5a7658cb72bfb5fd4bf9911157c0e9ac6a2687",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.17.0/bazel-gazelle-0.17.0.tar.gz"],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_download_sdk", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains()
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
go_download_sdk(
name = "go_sdk",
sdks = {
"linux_amd64": (
"go1.11.4.linux-amd64.tar.gz",
"fb26c30e6a04ad937bbc657a1b5bba92f80096af1e8ee6da6430c045a8db3a5b",
),
"darwin_amd64": (
"go1.11.4.darwin-amd64.tar.gz",
"48ea987fb610894b3108ecf42e7a4fd1c1e3eabcaeb570e388c75af1f1375f80",
),
},
)
go_rules_dependencies()
go_register_toolchains()
UBUNTU_MAP = {
"16_0_4": {
"sha256": "20c151c26c5a057a85d43bcc3dbee1d1fc536f76b84c550a1c2faa88af7727b6",
"url": "https://storage.googleapis.com/ubuntu_tar/20190708/ubuntu-xenial-core-cloudimg-amd64-root.tar.gz",
},
"18_0_4": {
"sha256": "600f663706aa8e7cb30d114daee117536545b5a580bca6a97b3cb73d72acdcee",
"url": "https://storage.googleapis.com/ubuntu_tar/20190704/ubuntu-bionic-core-cloudimg-amd64-root.tar.gz",
},
}
[http_file(
name = "ubuntu_%s_tar_download" % version,
sha256 = map["sha256"],
urls = [map["url"]],
) for version, map in UBUNTU_MAP.items()]
http_file(
name = "bazel_gpg",
sha256 = "30af2ca7abfb65987cd61802ca6e352aadc6129dfb5bfc9c81f16617bc3a4416",
urls = ["https://bazel.build/bazel-release.pub.gpg"],
)
http_file(
name = "launchpad_openjdk_gpg",
sha256 = "54b6274820df34a936ccc6f5cb725a9b7bb46075db7faf0ef7e2d86452fa09fd",
urls = ["http://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0xEB9B1D8886F44E2A"],
)