istio 编译-控制面

AEGQ · · 123 次点击 · · 开始浏览    

参考:

安装istio源码目录go.mod中相同版本的golang

# https://golang.google.cn/dl/
wget https://golang.google.cn/dl/go1.13.15.linux-amd64.tar.gz
tar -zxvf go1.13.15.linux-amd64.tar.gz 
mv go /usr/local/
echo "export PATH=$PATH:/usr/local/go/bin:/usr/local/bin" >> /etc/profile
source  /etc/profile
go version

下载源码

mkdir -p /root/go/src/istio.io
cd /root/go/src/istio.io
git clone https://github.com/istio/istio.git

准备环境

# vim /etc/profile
# 增加如下三行
export HUB="docker.io/xxx"
export TAG=1.6.7-aegq
export ISTIO=/root/go/src/istio.io
# export USE_LOCAL_PROXY=1
complete -W "\`find . -iname \"?akefil*\" | xargs -I {} grep -hoE '^[a-zA-Z0-9_.-]+:([^=]|$)' {} | sed 's/[^a-zA-Z0-9_.-]*$//' | sort -u\`" make

切换分支

cd /root/go/src/istio.io/istio
# 基于tag 创建分支
git checkout 1.6.7 1.6.7
git checkout 1.6.7

编译 - 控制面

# 编译生产镜像
make docker
# 编译可以调试的镜像
make DEBUG=1 docker

Unable to find image 'gcr.io/istio-testing/build-tools:release-1.6-2020-05-08T22-06-04' locally
release-1.6-2020-05-08T22-06-04: Pulling from istio-testing/build-tools
06545012c5bb: Pull complete 
862dd98fd577: Pull complete 
2bb4aeeb4280: Pull complete 
8e637325240d: Pull complete 
707439b60606: Pull complete 
552ec6eb4742: Pull complete 
38f312c161fa: Pull complete 
b28c3a90c19d: Pull complete 
9591c2c551c3: Pull complete 
fa08d5191fbf: Pull complete 
7b1f614ed19b: Pull complete 
e49771a3c442: Pull complete 
8ce4f5ab9220: Pull complete 
Digest: sha256:cf8fd2fa13b8afb97310218babcaf1d59b56cc54f59158244db2e8bd0a642bf0
Status: Downloaded newer image for gcr.io/istio-testing/build-tools:release-1.6-2020-05-08T22-06-04
=> Build with debugger information
ISTIO_OUT=/work/out/linux_amd64 ISTIO_BIN=/gobin GOOS_LOCAL=linux bin/init.sh
Skipping envoy debug. Set DEBUG_IMAGE to download.
/work/out/linux_amd64/release /work
Downloading Envoy: curl -fLSs https://storage.googleapis.com/istio-build/proxy/envoy-alpha-ccae1bd37085ecd78415dc06b50233b3b97e30c0.tar.gz to /work/out/linux_amd64/release/envoy-ccae1bd37085ecd78415dc06b50233b3b97e30c0

real    0m1.012s
user    0m0.565s
sys 0m0.194s
Copying /work/out/linux_amd64/release/envoy-ccae1bd37085ecd78415dc06b50233b3b97e30c0 to /work/out/linux_amd64/release/envoy
/work
/work/out/linux_amd64/release /work
Downloading WebAssembly file: curl -fLSs https://storage.googleapis.com/istio-build/proxy/stats-ccae1bd37085ecd78415dc06b50233b3b97e30c0.wasm to /work/out/linux_amd64/release/stats-ccae1bd37085ecd78415dc06b50233b3b97e30c0.wasm

real    0m0.320s
user    0m0.010s
sys 0m0.009s
/work
/work/out/linux_amd64/release /work
Downloading WebAssembly file: curl -fLSs https://storage.googleapis.com/istio-build/proxy/metadata_exchange-ccae1bd37085ecd78415dc06b50233b3b97e30c0.wasm to /work/out/linux_amd64/release/metadata_exchange-ccae1bd37085ecd78415dc06b50233b3b97e30c0.wasm

real    0m0.337s
user    0m0.015s
sys 0m0.007s
/work
Copying /work/out/linux_amd64/release/envoy-ccae1bd37085ecd78415dc06b50233b3b97e30c0 to /work/out/linux_amd64/envoy
touch /work/out/linux_amd64/istio_is_init
mkdir -p /work/out/linux_amd64/logs
mkdir -p /work/out/linux_amd64/release
STATIC=0 GOOS=linux GOARCH=amd64 LDFLAGS='-extldflags -static -s -w' common/scripts/gobuild.sh /work/out/linux_amd64/ ./istioctl/cmd/istioctl ./pilot/cmd/pilot-discovery ./pilot/cmd/pilot-agent ./mixer/cmd/mixs ./mixer/cmd/mixc ./mixer/tools/mixgen ./security/cmd/node_agent ./security/tools/sdsclient ./pkg/test/echo/cmd/client ./pkg/test/echo/cmd/server ./mixer/test/policybackend ./operator/cmd/operator
go: downloading istio.io/pkg v0.0.0-20200709220414-14d5de656564
go: downloading github.com/spf13/cobra v1.0.0
go: downloading github.com/golang/protobuf v1.3.5
go: downloading sigs.k8s.io/controller-runtime v0.5.1-0.20200327213554-2d4c4877f906
go: downloading github.com/gogo/protobuf v1.3.1
go: downloading k8s.io/api v0.18.1
go: downloading istio.io/api v0.0.0-20200724154434-34e474846e0d
go: downloading istio.io/gogo-genproto v0.0.0-20200709220749-8607e17318e8
go: downloading github.com/envoyproxy/go-control-plane v0.9.5-0.20200326174812-e8bd2869ff56
go: downloading google.golang.org/grpc v1.28.1
go: downloading k8s.io/apimachinery v0.18.1
go: downloading k8s.io/client-go v0.18.0
go: downloading github.com/prometheus/client_golang v1.1.0
go: downloading golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0
go: downloading github.com/opentracing/opentracing-go v1.0.2
go: downloading github.com/gorilla/mux v1.7.3
go: downloading golang.org/x/tools v0.0.0-20191216173652-a0e659d51361
go: downloading google.golang.org/genproto v0.0.0-20191223191004-3caeed10a8bf
go: downloading go.opencensus.io v0.22.2
go: downloading github.com/aws/aws-sdk-go v1.23.20
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/hashicorp/go-multierror v1.0.0
go: downloading github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
go: downloading k8s.io/cli-runtime v0.18.0
go: downloading github.com/envoyproxy/protoc-gen-validate v0.1.0
go: downloading k8s.io/apiextensions-apiserver v0.18.0
go: downloading github.com/cactus/go-statsd-client v3.1.1+incompatible
go: downloading github.com/openzipkin/zipkin-go v0.1.7
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading github.com/go-logr/logr v0.1.0
go: downloading github.com/go-redis/redis v6.10.2+incompatible
go: downloading golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582
go: downloading contrib.go.opencensus.io/exporter/zipkin v0.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/cenkalti/backoff v2.0.0+incompatible
go: downloading github.com/onsi/gomega v1.9.0
go: downloading github.com/open-policy-agent/opa v0.8.2
go: downloading github.com/google/go-cmp v0.4.0
go: downloading github.com/fatih/color v1.7.0
go: downloading sigs.k8s.io/kustomize v2.0.3+incompatible
go: downloading github.com/hashicorp/consul v1.3.1
go: downloading github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9
go: downloading gopkg.in/yaml.v2 v2.2.8
go: downloading github.com/istio/klog v0.0.0-20190424230111-fb7481ea8bcf
go: downloading github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c
go: downloading github.com/hashicorp/errwrap v1.0.0
go: downloading go.uber.org/zap v1.10.0
go: downloading golang.org/x/text v0.3.2
go: downloading github.com/googleapis/gnostic v0.3.1
go: downloading github.com/mattn/go-colorable v0.1.2
go: downloading contrib.go.opencensus.io/exporter/prometheus v0.1.0
go: downloading github.com/prometheus/procfs v0.0.8
go: downloading golang.org/x/sys v0.0.0-20200116001909-b77594299b42
go: downloading k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89
go: downloading golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
go: downloading github.com/hashicorp/go-version v1.2.0
go: downloading github.com/coreos/go-oidc v2.1.0+incompatible
go: downloading github.com/docker/distribution v2.7.1+incompatible
go: downloading cloud.google.com/go v0.50.0
go: downloading golang.org/x/crypto v0.0.0-20200414173820-0848c9571904
go: downloading go.uber.org/multierr v1.1.0
go: downloading github.com/mitchellh/copystructure v1.0.0
go: downloading github.com/gorilla/websocket v1.4.1
go: downloading github.com/yl2chen/cidranger v0.0.0-20180214081945-928b519e5268
go: downloading github.com/golang/sync v0.0.0-20180314180146-1d60e4601c6f
go: downloading github.com/natefinch/lumberjack v2.0.0+incompatible
go: downloading github.com/prometheus/common v0.6.0
go: downloading go.uber.org/atomic v1.4.0
go: downloading github.com/imdario/mergo v0.3.5
go: downloading github.com/uber/jaeger-client-go v0.0.0-20190228190846-ecf2d03a9e80
go: downloading github.com/hashicorp/go-cleanhttp v0.5.1
go: downloading helm.sh/helm/v3 v3.2.0
go: downloading github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20171214222146-0e7658f8ee99
go: downloading sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca
go: downloading github.com/cncf/udpa/go v0.0.0-20200313221541-5f7e5dd04533
go: downloading github.com/istio/viper v1.3.3-0.20190515210538-2789fed3109c
go: downloading sigs.k8s.io/structured-merge-diff/v3 v3.0.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/fsnotify/fsnotify v1.4.7
go: downloading sigs.k8s.io/service-apis v0.0.0-20200227172328-b9010cfacdbe
go: downloading github.com/pquerna/cachecontrol v0.0.0-20180306154005-525d0eb5f91d
go: downloading gomodules.xyz/jsonpatch/v2 v2.0.1
go: downloading github.com/mitchellh/reflectwalk v1.0.1
go: downloading github.com/hashicorp/go-rootcerts v1.0.1
go: downloading github.com/google/cel-go v0.4.1
go: downloading google.golang.org/api v0.15.0
go: downloading github.com/pelletier/go-toml v1.3.0
go: downloading github.com/DataDog/datadog-go v2.2.0+incompatible
go: downloading github.com/magiconair/properties v1.8.1
go: downloading github.com/uber/jaeger-lib v2.0.0+incompatible
go: downloading sigs.k8s.io/yaml v1.2.0
go: downloading github.com/mholt/archiver v3.1.1+incompatible
go: downloading github.com/googleapis/gax-go v2.0.2+incompatible
go: downloading github.com/prometheus/client_model v0.2.0
go: downloading gopkg.in/square/go-jose.v2 v2.3.1
go: downloading github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible
go: downloading github.com/opencontainers/go-digest v1.0.0-rc1
go: downloading github.com/openshift/api v3.9.1-0.20191008181517-e4fd21196097+incompatible
go: downloading github.com/pierrec/lz4 v2.2.7+incompatible
go: downloading github.com/dchest/siphash v1.1.0
go: downloading github.com/googleapis/gax-go/v2 v2.0.5
go: downloading github.com/golang/snappy v0.0.1
go: downloading github.com/census-instrumentation/opencensus-proto v0.2.1
go: downloading github.com/howeyc/fsnotify v0.9.0
go: downloading github.com/json-iterator/go v1.1.9
go: downloading github.com/go-openapi/spec v0.19.5
go: downloading github.com/evanphx/json-patch v4.5.0+incompatible
go: downloading github.com/ghodss/yaml v1.0.0
go: downloading github.com/ulikunitz/xz v0.5.6
go: downloading github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading github.com/google/gofuzz v1.1.0
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/kylelemons/godebug v1.1.0
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
go: downloading github.com/dsnet/compress v0.0.1
go: downloading github.com/antlr/antlr4 v0.0.0-20190819145818-b43a4c3a8015
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading github.com/Masterminds/semver v1.4.2
go: downloading github.com/ryanuber/go-glob v1.0.0
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
go: downloading github.com/spf13/cast v1.3.1
go: downloading github.com/go-openapi/jsonpointer v0.19.3
go: downloading github.com/beorn7/perks v1.0.1
go: downloading k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c
go: downloading github.com/xeipuuv/gojsonschema v1.1.0
go: downloading github.com/google/uuid v1.1.1
go: downloading github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
go: downloading github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
go: downloading github.com/Masterminds/semver/v3 v3.1.0
go: downloading github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af
go: downloading github.com/fluent/fluent-logger-golang v1.3.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading cloud.google.com/go/logging v1.0.0
go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4
go: downloading github.com/BurntSushi/toml v0.3.1
go: downloading github.com/hashicorp/serf v0.8.5
go: downloading github.com/cyphar/filepath-securejoin v0.2.2
go: downloading github.com/cheggaaa/pb/v3 v3.0.4
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: downloading github.com/yashtewari/glob-intersection v0.0.0-20180206001645-7af743e8ec84
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
go: downloading github.com/circonus-labs/circonusllhist v0.1.4
go: downloading github.com/tinylib/msgp v1.0.2
go: downloading github.com/go-openapi/swag v0.19.6
go: downloading github.com/peterbourgon/diskv v2.0.1+incompatible
go: downloading github.com/miekg/dns v1.0.14
go: downloading github.com/emicklei/go-restful v2.9.6+incompatible
go: downloading github.com/Masterminds/sprig v2.20.0+incompatible
go: downloading github.com/mailru/easyjson v0.7.0
go: downloading github.com/Masterminds/sprig/v3 v3.1.0
go: downloading github.com/prometheus/prom2json v1.2.2
go: downloading github.com/kr/pretty v0.1.0
go: downloading github.com/VividCortex/ewma v1.1.1
go: downloading github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c
go: downloading github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a
go: downloading github.com/google/btree v1.0.0
go: downloading github.com/russross/blackfriday v1.5.2
go: downloading github.com/mattn/go-runewidth v0.0.7
go: downloading github.com/hashicorp/go-retryablehttp v0.5.4
go: downloading github.com/spf13/afero v1.2.2
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/gobwas/glob v0.2.3
go: downloading github.com/Masterminds/goutils v1.1.0
go: downloading github.com/philhofer/fwd v1.0.0
go: downloading contrib.go.opencensus.io/exporter/stackdriver v0.12.9
go: downloading github.com/mitchellh/mapstructure v1.1.2
go: downloading github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb
go: downloading github.com/huandu/xstrings v1.3.1
go: downloading gopkg.in/fsnotify.v1 v1.4.7
go: downloading github.com/go-openapi/jsonreference v0.19.3
go: downloading github.com/hashicorp/vault/api v1.0.3
go: downloading github.com/kr/text v0.1.0
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/gophercloud/gophercloud v0.1.0
go: downloading k8s.io/kubectl v0.18.0
go: downloading github.com/PuerkitoBio/purell v1.1.1
go: downloading github.com/hashicorp/vault/sdk v0.1.12
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go: downloading github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
go: downloading github.com/nwaples/rardecode v1.0.0
go: downloading github.com/hashicorp/go-immutable-radix v1.0.0
go: downloading github.com/Azure/go-autorest/autorest v0.9.4
go: downloading github.com/Azure/go-autorest/autorest/adal v0.8.3
go: downloading github.com/Azure/go-autorest/tracing v0.5.0
go: downloading github.com/Azure/go-autorest/autorest/date v0.2.0
go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: downloading github.com/Azure/go-autorest/logger v0.1.0
go: downloading github.com/hashicorp/go-sockaddr v1.0.2
go: downloading golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e

real    0m42.172s
user    5m46.539s
sys 1m15.968s
time (mkdir -p /work/out/linux_amd64/docker_build/docker.pilot && cp -r pilot/docker/Dockerfile.pilot /work/out/linux_amd64/pilot-discovery tests/testdata/certs/cacert.pem /work/out/linux_amd64/docker_build/docker.pilot && cd /work/out/linux_amd64/docker_build/docker.pilot && chmod 755 pilot-discovery cacert.pem && docker build --build-arg BASE_VERSION=1.6-dev.6 --build-arg BASE_DISTRIBUTION=default -t istio/pilot:2511ab8c8c59a203e77bb804846593c3690fcf4a -f Dockerfile.pilot . ); 
Sending build context to Docker daemon  110.9MB
Step 1/10 : ARG BASE_DISTRIBUTION=default
Step 2/10 : ARG BASE_VERSION=latest
Step 3/10 : FROM docker.io/istio/base:${BASE_VERSION} as default
1.6-dev.6: Pulling from istio/base
23884877105a: Pull complete 
bc38caa0f5b9: Pull complete 
2910811b6c42: Pull complete 
36505266dcc6: Pull complete 
ef1ba44e5e31: Pull complete 
ff9ebc47a0e1: Pull complete 
Digest: sha256:ade0e7ea59ae8d78a0a236c69d6402231dba1c5dc6aa69d157dad4222b57c3b2
Status: Downloaded newer image for istio/base:1.6-dev.6
 ---> 84723039b314
Step 4/10 : USER 1337:1337
 ---> Running in ff8ca22618db
Removing intermediate container ff8ca22618db
 ---> 46d4f50e30f9
Step 5/10 : FROM gcr.io/distroless/static@sha256:23aa732bba4c8618c0d97c26a72a32997363d591807b0d4c31b0bbc8a774bddf as distroless
sha256:23aa732bba4c8618c0d97c26a72a32997363d591807b0d4c31b0bbc8a774bddf: Pulling from distroless/static
24f0c933cbef: Already exists 
3c2cba919283: Already exists 
Digest: sha256:23aa732bba4c8618c0d97c26a72a32997363d591807b0d4c31b0bbc8a774bddf
Status: Downloaded newer image for gcr.io/distroless/static@sha256:23aa732bba4c8618c0d97c26a72a32997363d591807b0d4c31b0bbc8a774bddf
 ---> 52ed073f70ec
Step 6/10 : WORKDIR /
 ---> Running in 7ffbf93d123b
Removing intermediate container 7ffbf93d123b
 ---> dc67a07860d5
Step 7/10 : FROM ${BASE_DISTRIBUTION}
 ---> 46d4f50e30f9
Step 8/10 : COPY pilot-discovery /usr/local/bin/
 ---> 472b14786314
Step 9/10 : COPY cacert.pem /cacert.pem
 ---> f213435de906
Step 10/10 : ENTRYPOINT ["/usr/local/bin/pilot-discovery"]
 ---> Running in 50d48b25a5a4
Removing intermediate container 50d48b25a5a4
 ---> 33e4acfae57a
Successfully built 33e4acfae57a
Successfully tagged istio/pilot:2511ab8c8c59a203e77bb804846593c3690fcf4a

real    0m8.110s
user    0m0.074s
sys 0m0.238s
time (mkdir -p /work/out/linux_amd64/docker_build/docker.proxyv2 && cp -r /work/out/linux_amd64/release/metadata-exchange-filter.wasm /work/tools/packaging/common//envoy_bootstrap_v2.json install/gcp/bootstrap/gcp_envoy_bootstrap.json /work/out/linux_amd64/release/envoy /work/out/linux_amd64/pilot-agent pilot/docker/Dockerfile.proxyv2 pilot/docker/envoy_policy.yaml.tmpl /work/out/linux_amd64/release/stats-filter.wasm /work/out/linux_amd64/docker_build/docker.proxyv2 && cd /work/out/linux_amd64/docker_build/docker.proxyv2 && chmod 755 envoy pilot-agent && docker build --build-arg proxy_version=istio-proxy:ccae1bd37085ecd78415dc06b50233b3b97e30c0 --build-arg istio_version=1.6-dev --build-arg BASE_VERSION=1.6-dev.6 --build-arg BASE_DISTRIBUTION=default -t istio/proxyv2:2511ab8c8c59a203e77bb804846593c3690fcf4a -f Dockerfile.proxyv2 . ); 
Sending build context to Docker daemon  176.2MB
Step 1/25 : ARG BASE_DISTRIBUTION=default
Step 2/25 : ARG BASE_VERSION=latest
Step 3/25 : FROM docker.io/istio/base:${BASE_VERSION} as default
 ---> 84723039b314
Step 4/25 : COPY envoy_bootstrap_v2.json /var/lib/istio/envoy/envoy_bootstrap_tmpl.json
 ---> 6e3ebd213c5f
Step 5/25 : COPY gcp_envoy_bootstrap.json /var/lib/istio/envoy/gcp_envoy_bootstrap_tmpl.json
 ---> a90971e4300f
Step 6/25 : RUN chown -R istio-proxy /var/lib/istio
 ---> Running in c7218e078ef4
Removing intermediate container c7218e078ef4
 ---> f5f2082fca25
Step 7/25 : FROM gcr.io/distroless/cc@sha256:f81e5db8287d66b012d874a6f7fea8da5b96d9cc509aa5a9b5d095a604d4bca1 as distroless
sha256:f81e5db8287d66b012d874a6f7fea8da5b96d9cc509aa5a9b5d095a604d4bca1: Pulling from distroless/cc
9ff2acc3204b: Pull complete 
69e2f037cdb3: Pull complete 
3e010093287c: Pull complete 
Digest: sha256:f81e5db8287d66b012d874a6f7fea8da5b96d9cc509aa5a9b5d095a604d4bca1
Status: Downloaded newer image for gcr.io/distroless/cc@sha256:f81e5db8287d66b012d874a6f7fea8da5b96d9cc509aa5a9b5d095a604d4bca1
 ---> 6280d9cbc14f
Step 8/25 : COPY --from=default /sbin/xtables-multi /sbin/iptables* /sbin/ip6tables* /sbin/ip /sbin/
 ---> 7c2b812c259f
Step 9/25 : COPY --from=default /usr/lib/x86_64-linux-gnu/xtables/ /usr/lib/x86_64-linux-gnu/xtables
 ---> 61ba97669f74
Step 10/25 : COPY --from=default /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu
 ---> cf5cbda5df89
Step 11/25 : COPY --from=default /etc/iproute2 /etc/iproute2
 ---> 9ccc97236865
Step 12/25 : COPY --chown=nonroot:nonroot envoy_bootstrap_v2.json /var/lib/istio/envoy/envoy_bootstrap_tmpl.json
 ---> d1787394bed0
Step 13/25 : COPY --chown=nonroot:nonroot gcp_envoy_bootstrap.json /var/lib/istio/envoy/gcp_envoy_bootstrap_tmpl.json
 ---> c3b33bbb529a
Step 14/25 : WORKDIR /
 ---> Running in 5c1cf076317f
Removing intermediate container 5c1cf076317f
 ---> 38e803c439fd
Step 15/25 : FROM ${BASE_DISTRIBUTION}
 ---> f5f2082fca25
Step 16/25 : ARG proxy_version
 ---> Running in 03d390005fd5
Removing intermediate container 03d390005fd5
 ---> 3b424d96961e
Step 17/25 : ARG istio_version
 ---> Running in 7db6ddee2936
Removing intermediate container 7db6ddee2936
 ---> b4a566a51171
Step 18/25 : COPY envoy /usr/local/bin/envoy
 ---> 455926834a19
Step 19/25 : ENV ISTIO_META_ISTIO_PROXY_SHA $proxy_version
 ---> Running in 4ced20f2cae7
Removing intermediate container 4ced20f2cae7
 ---> d67aaf3d6a6c
Step 20/25 : ENV ISTIO_META_ISTIO_VERSION $istio_version
 ---> Running in aa2379ce4b61
Removing intermediate container aa2379ce4b61
 ---> d4206ac49c5c
Step 21/25 : COPY pilot-agent /usr/local/bin/pilot-agent
 ---> d51179bb7258
Step 22/25 : COPY envoy_policy.yaml.tmpl /var/lib/istio/envoy/envoy_policy.yaml.tmpl
 ---> f58cc9eaa197
Step 23/25 : COPY stats-filter.wasm /etc/istio/extensions/stats-filter.wasm
 ---> 83b87fe26023
Step 24/25 : COPY metadata-exchange-filter.wasm /etc/istio/extensions/metadata-exchange-filter.wasm
 ---> 1e8e4bed056c
Step 25/25 : ENTRYPOINT ["/usr/local/bin/pilot-agent"]
 ---> Running in 54afb361377a
Removing intermediate container 54afb361377a
 ---> fd3fb736770a
Successfully built fd3fb736770a
Successfully tagged istio/proxyv2:2511ab8c8c59a203e77bb804846593c3690fcf4a

real    0m8.530s
user    0m0.126s
sys 0m0.333s
mkdir -p /work/out/linux_amd64/docker_temp
cp -a tests/testdata/certs /work/out/linux_amd64/docker_temp/.
time (mkdir -p /work/out/linux_amd64/docker_build/docker.app && cp -r /work/out/linux_amd64/docker_temp/certs pkg/test/echo/docker/Dockerfile.app /work/out/linux_amd64/client /work/out/linux_amd64/server /work/out/linux_amd64/docker_build/docker.app && cd /work/out/linux_amd64/docker_build/docker.app && chmod 755 server client && docker build --build-arg BASE_VERSION=1.6-dev.6 --build-arg BASE_DISTRIBUTION=default -t istio/app:2511ab8c8c59a203e77bb804846593c3690fcf4a -f Dockerfile.app . ); 
Sending build context to Docker daemon  32.93MB
Step 1/7 : ARG BASE_VERSION=latest
Step 2/7 : FROM docker.io/istio/base:${BASE_VERSION}
 ---> 84723039b314
Step 3/7 : COPY client /usr/local/bin/client
 ---> d5523894806e
Step 4/7 : COPY server /usr/local/bin/server
 ---> 6fb006a49c50
Step 5/7 : COPY certs/cert.crt /cert.crt
 ---> 9f8b601589fe
Step 6/7 : COPY certs/cert.key /cert.key
 ---> ef4767a68c6f
Step 7/7 : ENTRYPOINT ["/usr/local/bin/server"]
 ---> Running in 61a56d0a3b81
Removing intermediate container 61a56d0a3b81
 ---> 4a5aa5b31b55
[Warning] One or more build-args [BASE_DISTRIBUTION] were not consumed
Successfully built 4a5aa5b31b55
Successfully tagged istio/app:2511ab8c8c59a203e77bb804846593c3690fcf4a

real    0m1.243s
user    0m0.048s
sys 0m0.076s
rm -f /work/out/linux_amd64/release/istio-sidecar.deb
fpm -s dir -t deb -n istio-sidecar -p /work/out/linux_amd64/release/istio-sidecar.deb --version 1.6dev -f \
    --url http://istio.io  \
    --license Apache \
    --vendor istio.io \
    --maintainer istio@istio.io \
    --after-install tools/packaging/deb/postinst.sh \
    --config-files /var/lib/istio/envoy/envoy_bootstrap_tmpl.json \
    --config-files /var/lib/istio/envoy/sidecar.env \
    --description "Istio Sidecar" \
    --depends iproute2 \
    --depends iptables \
     /work/out/linux_amd64/envoy=/usr/local/bin/envoy /work/out/linux_amd64/pilot-agent=/usr/local/bin/pilot-agent /work/out/linux_amd64/node_agent=/usr/local/bin/node_agent /work/tools/packaging/common/istio-start.sh=/usr/local/bin/istio-start.sh /work/tools/packaging/common/istio.service=/lib/systemd/system/istio.service /work/tools/packaging/common/sidecar.env=/var/lib/istio/envoy/sidecar.env /work/tools/packaging/common/envoy_bootstrap_v2.json=/var/lib/istio/envoy/envoy_bootstrap_tmpl.json
Doing `require 'backports'` is deprecated and will not load any backport in the next major release.
Require just the needed backports instead, or 'backports/latest'.
/usr/local/lib/ruby/gems/2.6.0/gems/fpm-1.11.0/lib/fpm/util.rb:29: warning: Insecure world writable dir /gobin in PATH, mode 040777
Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {:level=>:warn}
Created package {:path=>"/work/out/linux_amd64/release/istio-sidecar.deb"}
time (mkdir -p /work/out/linux_amd64/docker_build/docker.app_sidecar && cp -r pkg/test/echo/docker/Dockerfile.app_sidecar tools/packaging/common/envoy_bootstrap_v2.json /work/out/linux_amd64/release/istio-sidecar.deb /work/out/linux_amd64/docker_temp/certs pkg/test/echo/docker/echo-start.sh /work/out/linux_amd64/client /work/out/linux_amd64/server /work/out/linux_amd64/docker_build/docker.app_sidecar && cd /work/out/linux_amd64/docker_build/docker.app_sidecar  && docker build --build-arg BASE_VERSION=1.6-dev.6 --build-arg BASE_DISTRIBUTION=default -t istio/app_sidecar:2511ab8c8c59a203e77bb804846593c3690fcf4a -f Dockerfile.app_sidecar . ); 
Sending build context to Docker daemon   95.9MB
Step 1/10 : ARG BASE_VERSION=latest
Step 2/10 : FROM docker.io/istio/base:${BASE_VERSION}
 ---> 84723039b314
Step 3/10 : COPY certs/                           /var/lib/istio/
 ---> 58982f2a8ddc
Step 4/10 : COPY certs/default/*                  /var/run/secrets/istio/
 ---> 104f137e6a8a
Step 5/10 : COPY istio-sidecar.deb  /tmp/istio-sidecar.deb
 ---> 6c92f4797b90
Step 6/10 : RUN dpkg -i /tmp/istio-sidecar.deb && rm /tmp/istio-sidecar.deb
 ---> Running in 63a7678565fc
Selecting previously unselected package istio-sidecar.
(Reading database ... 6049 files and directories currently installed.)
Preparing to unpack /tmp/istio-sidecar.deb ...
Unpacking istio-sidecar (1.6dev) ...
Setting up istio-sidecar (1.6dev) ...
Removing intermediate container 63a7678565fc
 ---> 5358413f6d8c
Step 7/10 : COPY echo-start.sh /usr/local/bin/echo-start.sh
 ---> 869c27c2b81d
Step 8/10 : COPY client /usr/local/bin/client
 ---> d573ecdd33e4
Step 9/10 : COPY server /usr/local/bin/server
 ---> 570ac37581c4
Step 10/10 : ENTRYPOINT ["/usr/local/bin/echo-start.sh"]
 ---> Running in e47fcee3620c
Removing intermediate container e47fcee3620c
 ---> 6a613896466e
[Warning] One or more build-args [BASE_DISTRIBUTION] were not consumed
Successfully built 6a613896466e
Successfully tagged istio/app_sidecar:2511ab8c8c59a203e77bb804846593c3690fcf4a

real    0m5.761s
user    0m0.078s
sys 0m0.197s
time (mkdir -p /work/out/linux_amd64/docker_build/docker.test_policybackend && cp -r /work/out/linux_amd64/policybackend mixer/docker/Dockerfile.test_policybackend /work/out/linux_amd64/docker_build/docker.test_policybackend && cd /work/out/linux_amd64/docker_build/docker.test_policybackend  && docker build --build-arg BASE_VERSION=1.6-dev.6 --build-arg BASE_DISTRIBUTION=default -t istio/test_policybackend:2511ab8c8c59a203e77bb804846593c3690fcf4a -f Dockerfile.test_policybackend . ); 
Sending build context to Docker daemon   20.5MB
Step 1/7 : ARG BASE_DISTRIBUTION=default
Step 2/7 : ARG BASE_VERSION=latest
Step 3/7 : FROM docker.io/istio/base:${BASE_VERSION} as default
 ---> 84723039b314
Step 4/7 : FROM gcr.io/distroless/static@sha256:c6d5981545ce1406d33e61434c61e9452dad93ecd8397c41e89036ef977a88f4 as distroless
sha256:c6d5981545ce1406d33e61434c61e9452dad93ecd8397c41e89036ef977a88f4: Pulling from distroless/static
9ff2acc3204b: Already exists 
Digest: sha256:c6d5981545ce1406d33e61434c61e9452dad93ecd8397c41e89036ef977a88f4
Status: Downloaded newer image for gcr.io/distroless/static@sha256:c6d5981545ce1406d33e61434c61e9452dad93ecd8397c41e89036ef977a88f4
 ---> e4d2a899b1bf
Step 5/7 : FROM ${BASE_DISTRIBUTION}
 ---> 84723039b314
Step 6/7 : COPY policybackend /usr/local/bin/policybackend
 ---> 47f7912b85c7
Step 7/7 : ENTRYPOINT ["/usr/local/bin/policybackend", "server"]
 ---> Running in 9084e9132d9f
Removing intermediate container 9084e9132d9f
 ---> f13be704b02f
Successfully built f13be704b02f
Successfully tagged istio/test_policybackend:2511ab8c8c59a203e77bb804846593c3690fcf4a

real    0m1.145s
user    0m0.042s
sys 0m0.060s
cp /work/out/linux_amd64/mixs /work/out/linux_amd64/docker_temp/mixs
time (mkdir -p /work/out/linux_amd64/docker_build/docker.mixer && cp -r /work/out/linux_amd64/docker_temp/mixs mixer/docker/Dockerfile.mixer /work/out/linux_amd64/docker_build/docker.mixer && cd /work/out/linux_amd64/docker_build/docker.mixer && chmod 755 mixs && docker build --build-arg BASE_VERSION=1.6-dev.6 --build-arg BASE_DISTRIBUTION=default -t istio/mixer:2511ab8c8c59a203e77bb804846593c3690fcf4a -f Dockerfile.mixer . ); 
Sending build context to Docker daemon  115.8MB
Step 1/10 : ARG BASE_DISTRIBUTION=default
Step 2/10 : ARG BASE_VERSION=latest
Step 3/10 : FROM docker.io/istio/base:${BASE_VERSION} as default
 ---> 84723039b314
Step 4/10 : USER 1337:1337
 ---> Using cache
 ---> 46d4f50e30f9
Step 5/10 : FROM gcr.io/distroless/static@sha256:23aa732bba4c8618c0d97c26a72a32997363d591807b0d4c31b0bbc8a774bddf as distroless
 ---> 52ed073f70ec
Step 6/10 : WORKDIR /
 ---> Using cache
 ---> dc67a07860d5
Step 7/10 : FROM ${BASE_DISTRIBUTION}
 ---> 46d4f50e30f9
Step 8/10 : COPY mixs /usr/local/bin/
 ---> 77e4a762f672
Step 9/10 : ENTRYPOINT ["/usr/local/bin/mixs", "server"]
 ---> Running in 5bfa5f3335b7
Removing intermediate container 5bfa5f3335b7
 ---> db28aa5485e2
Step 10/10 : CMD ["--configStoreURL=fs:///etc/opt/mixer/configroot","--configStoreURL=k8s://"]
 ---> Running in d9e33f35e017
Removing intermediate container d9e33f35e017
 ---> 5e3997c716dc
Successfully built 5e3997c716dc
Successfully tagged istio/mixer:2511ab8c8c59a203e77bb804846593c3690fcf4a

real    0m2.004s
user    0m0.078s
sys 0m0.228s
cp /work/out/linux_amd64/mixgen /work/out/linux_amd64/docker_temp/mixgen
time (mkdir -p /work/out/linux_amd64/docker_build/docker.mixer_codegen && cp -r /work/out/linux_amd64/docker_temp/mixgen mixer/docker/Dockerfile.mixer_codegen /work/out/linux_amd64/docker_build/docker.mixer_codegen && cd /work/out/linux_amd64/docker_build/docker.mixer_codegen  && docker build --build-arg BASE_VERSION=1.6-dev.6 --build-arg BASE_DISTRIBUTION=default -t istio/mixer_codegen:2511ab8c8c59a203e77bb804846593c3690fcf4a -f Dockerfile.mixer_codegen . ); 
Sending build context to Docker daemon  22.26MB
Step 1/8 : ARG BASE_DISTRIBUTION=default
Step 2/8 : ARG BASE_VERSION=latest
Step 3/8 : FROM docker.io/istio/base:${BASE_VERSION} as default
 ---> 84723039b314
Step 4/8 : USER 1337:1337
 ---> Using cache
 ---> 46d4f50e30f9
Step 5/8 : FROM gcr.io/distroless/static@sha256:23aa732bba4c8618c0d97c26a72a32997363d591807b0d4c31b0bbc8a774bddf as distroless
 ---> 52ed073f70ec
Step 6/8 : FROM ${BASE_DISTRIBUTION}
 ---> 46d4f50e30f9
Step 7/8 : COPY mixgen /usr/local/bin/
 ---> 343db0d39dc2
Step 8/8 : ENTRYPOINT ["/usr/local/bin/mixgen"]
 ---> Running in 2fddcbf61a68
Removing intermediate container 2fddcbf61a68
 ---> cfa757ba0d16
Successfully built cfa757ba0d16
Successfully tagged istio/mixer_codegen:2511ab8c8c59a203e77bb804846593c3690fcf4a

real    0m0.672s
user    0m0.033s
sys 0m0.073s
time (mkdir -p /work/out/linux_amd64/docker_build/docker.istioctl && cp -r /work/out/linux_amd64/istioctl istioctl/docker/Dockerfile.istioctl /work/out/linux_amd64/docker_build/docker.istioctl && cd /work/out/linux_amd64/docker_build/docker.istioctl  && docker build --build-arg BASE_VERSION=1.6-dev.6 --build-arg BASE_DISTRIBUTION=default -t istio/istioctl:2511ab8c8c59a203e77bb804846593c3690fcf4a -f Dockerfile.istioctl . ); 
Sending build context to Docker daemon  117.2MB
Step 1/5 : ARG BASE_VERSION=latest
Step 2/5 : FROM docker.io/istio/base:${BASE_VERSION}
 ---> 84723039b314
Step 3/5 : USER 1000:1000
 ---> Running in 5fd8b7aad4b5
Removing intermediate container 5fd8b7aad4b5
 ---> 4d3d6c8b0c2c
Step 4/5 : COPY istioctl /usr/local/bin/
 ---> 4133432d880a
Step 5/5 : ENTRYPOINT ["/usr/local/bin/istioctl"]
 ---> Running in 5dadc7c93ac3
Removing intermediate container 5dadc7c93ac3
 ---> ebfe0824948f
[Warning] One or more build-args [BASE_DISTRIBUTION] were not consumed
Successfully built ebfe0824948f
Successfully tagged istio/istioctl:2511ab8c8c59a203e77bb804846593c3690fcf4a

real    0m1.951s
user    0m0.086s
sys 0m0.216s
time (mkdir -p /work/out/linux_amd64/docker_build/docker.operator && cp -r /work/out/linux_amd64/operator manifests/ operator/docker/Dockerfile.operator /work/out/linux_amd64/docker_build/docker.operator && cd /work/out/linux_amd64/docker_build/docker.operator  && docker build --build-arg BASE_VERSION=1.6-dev.6 --build-arg BASE_DISTRIBUTION=default -t istio/operator:2511ab8c8c59a203e77bb804846593c3690fcf4a -f Dockerfile.operator . ); 
Sending build context to Docker daemon   92.8MB
Step 1/8 : ARG BASE_DISTRIBUTION=default
Step 2/8 : ARG BASE_VERSION=latest
Step 3/8 : FROM docker.io/istio/base:${BASE_VERSION} as default
 ---> 84723039b314
Step 4/8 : FROM gcr.io/distroless/static@sha256:23aa732bba4c8618c0d97c26a72a32997363d591807b0d4c31b0bbc8a774bddf as distroless
 ---> 52ed073f70ec
Step 5/8 : FROM ${BASE_DISTRIBUTION}
 ---> 84723039b314
Step 6/8 : COPY operator /usr/local/bin/
 ---> d134e00e5c7e
Step 7/8 : COPY manifests/ /var/lib/istio/manifests/
 ---> e910878eef5b
Step 8/8 : ENTRYPOINT ["/usr/local/bin/operator"]
 ---> Running in 7d5d976ebe8c
Removing intermediate container 7d5d976ebe8c
 ---> 20a94e0d412a
Successfully built 20a94e0d412a
Successfully tagged istio/operator:2511ab8c8c59a203e77bb804846593c3690fcf4a

real    0m1.796s
user    0m0.077s
sys 0m0.196s

查看生成的镜像

# docker images|grep aegq
xxx/operator                                             1.6.7-aegq                        092bc7a6dff5        8 minutes ago       247MB
xxx/istioctl                                             1.6.7-aegq                        9495285c9153        8 minutes ago       271MB
xxx/mixer                                                1.6.7-aegq                        a5eff2d62a67        8 minutes ago       270MB
xxx/mixer_codegen                                        1.6.7-aegq                        2ea5e0f49330        8 minutes ago       176MB
xxx/test_policybackend                                   1.6.7-aegq                        fb8a27048c5a        8 minutes ago       174MB
xxx/app_sidecar                                          1.6.7-aegq                        e9732bae8dd5        8 minutes ago       473MB
xxx/app                                                  1.6.7-aegq                        6ec28095d2ee        8 minutes ago       187MB
xxx/proxyv2                                              1.6.7-aegq                        23f4ba72df34        8 minutes ago       330MB
xxx/pilot                                                1.6.7-aegq                        61b1bae40eb4        8 minutes ago       265MB

清理

make clean
docker images |grep min|awk '{print $1":"$2}'|grep -v none|xargs docker rmi

有疑问加站长微信联系(非本文作者)

本文来自:简书

感谢作者:AEGQ

查看原文:istio 编译-控制面

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:1006366459

123 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传