【Kubernetes社區之路】Bazel安裝

建議跟據官方指導文檔(https://docs.bazel.build/install.html)進行安裝Bazel。像其餘開源工具同樣,Bazel官方文檔介紹瞭如何在各類操做系統上安裝,也有從源碼安裝的詳細指導。html

在CentOS 7上安裝

Bazel開發團隊並無提供針對Fedora和CentOS的官方包,是Redhat公司一位名叫Vincent Batts的工程師維護的。工具

下載yum源配置文件

使用wget命令下載yum源配置文件:ui

[root@ecs-d8b6 ~]# wget https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.rep
--2019-06-28 20:16:02--  https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.rep
Resolving copr.fedorainfracloud.org (copr.fedorainfracloud.org)... 209.132.184.54
Connecting to copr.fedorainfracloud.org (copr.fedorainfracloud.org)|209.132.184.54|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 314 [text/plain]
Saving to: ‘vbatts-bazel-epel-7.rep’

100%[==================================================================================>] 314         --.-K/s   in 0s      

2019-06-28 20:16:03 (83.7 MB/s) - ‘vbatts-bazel-epel-7.rep’ saved [314/314]

[root@ecs-d8b6 ~]#

下載完的文件存放在當前目錄下的vbatts-bazel-epel-7.rep文件中,你也能夠不用wget下載而手動建立他,文件內容以下:url

[root@ecs-d8b6 ~]# cat vbatts-bazel-epel-7.rep 
[vbatts-bazel]
name=Copr repo for bazel owned by vbatts
baseurl=https://copr-be.cloud.fedoraproject.org/results/vbatts/bazel/epel-7-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/vbatts/bazel/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1

接下來將下載的vbatts-bazel-epel-7.rep文件拷貝到yum倉庫配置目錄/etc/yum.repos.d/:操作系統

[root@ecs-d8b6 ~]# mv vbatts-bazel-epel-7.rep /etc/yum.repos.d/

使用yum安裝

首先使用yum list bazel命令來查看上一步新加的yum配置文件是否已經生效:code

[root@ecs-d8b6 ~]# yum list bazel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.nus.edu.sg
 * epel: mirrors.aliyun.com
 * extras: mirror.nus.edu.sg
 * updates: mirror.nus.edu.sg
Available Packages
bazel.x86_64                                            0.27.0-7.el7                                            vbatts-bazel

能夠看到,已經有一個0.27版本的能夠安裝了。htm

使用yum install bazel命令來安裝:ip

[root@ecs-d8b6 ~]# yum install bazel

安裝過程當中分提示安裝所需的依賴包,按操做提示便可完成安裝。開發

安裝完成後,bazel會自動存放在/usr/bin/目錄下:文檔

[root@ecs-d8b6 ~]# which bazel
/usr/bin/bazel
相關文章
相關標籤/搜索