kubevela/Dockerfile

51 lines
1.8 KiB
Docker
Raw Permalink Normal View History

ARG BASE_IMAGE
2020-07-06 23:45:29 +08:00
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:2381c1e5f8350a901597d633b2e517775eeac7a6682be39225a93b22cfd0f8bb as builder
2020-07-06 23:45:29 +08:00
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
Feat: merge master into apiserver (#2660) * Feat(rollout): fill rolloutBatches if empty when scale up/down (#2569) * Feat: fill rolloutBatches if empty * Fix: fix unit-test * Test: add more test Fix: lint Fix: fix lint * Update release.yml (#2537) * Feat: add registry, merge registry and cap center (#2528) * Feat: add registry command * Refactor: comp/trait command combine with registry * Feat: refactor `vela comp/trait` * Fix: import * Fix: fix if type is autodetects.core.oam.dev * Fix: fix list from url * Fix: test * Feat: add test * Fix: remove dup test * Fix: test * Fix: test * Fix: fix label filter * Fix: reviewable * Fix test * fix personal repo in test * Fix test * Fix test * add some boundary check * reviewable * Fix: fix nocalhost trait (#2577) * fix incorrect addon status (#2576) * Fix(cli): client-side throttling in vela CLI (#2581) * fix cli throttling * fix import * set to a lower value * remove addon with no defs (#2574) * Feat: vela logs support multicluster (#2593) * Feat: add basic multiple cluster logs * fix context * Fix select style * Fix select style * remove useless env * fix naming * Feat: vela cluster support use ocm to join/list/detach cluster (#2599) * Feat: add render component and apply component remaining (#2587) * Feat: add render component and apply component remaining * fix ut * fix e2e * allow import package in custom status cue template (#2585) Co-authored-by: chwetion <chwetion@foxmail.com> * Fix: abnormal aux name (#2612) * Feat: store workflow step def properties in cm (#2592) * Fix: fix notification def * Feat: store workflow step def properties in cm * fix ci * fix data race * Fix: change Initializer to Application for addon Observability (#2615) In this doc, updated the Observability implementation from initializer to Application. I also store definitions as it's not well stored in vela-templates/addons/observability * Fix: fix backport param (#2611) * Fix: add owner reference in workflow context cm (#2573) * Fix: add owner reference in workflow context cm * fix ci * delete useless test case * Fix: op.delete bugs (#2622) * Fix: op.delete some bugs * Fix: app status update error Fix: make reviewable * Fix: show reconcile error log (#2626) * Feat: add reconcile timeout configuration for vela-core (#2630) * Fix: patch status retry while conflict happens (#2629) * Fix: allow definition schema cm can be same name in different definition type (#2618) * Fix: fix definition schema cm name * fix ut * fix ut * fix show * add switch default case * Feat: remove envbinding policy into workflow (#2556) Fix: add more test * Feat: add vela prob to test cluster (#2635) * Fix: upgrade stern lib to avoid panic for vela logs (#2650) * Fix: filter loggable workload in vela logs (#2651) * Fix: filter loggable workload in vela logs * reviewable * Feat: add vela exec for multi cluster (#2299) fix support vela exec * Fix: health check will check for multiclusters (#2645) * Fix: minor fix for vela cli printing (#2655) * Fix: minor fix for vela cli printing * add dockerfile go mod cache * Feat: support apiserver-related multicluster features (#2625) * Feat: remove envbinding policy into workflow Feat: add support for env change (env gc) Fix: fix rollout timeout setting bug * Feat: support disable trait and env without workflow * Fix: add hint for replaced value Co-authored-by: wyike <wangyike_wyk@163.com> Co-authored-by: basefas <basefas@hotmail.com> Co-authored-by: qiaozp <47812250+chivalryq@users.noreply.github.com> Co-authored-by: Tianxin Dong <dongtianxin.tx@alibaba-inc.com> Co-authored-by: yangsoon <yangsoonlx@gmail.com> Co-authored-by: Chwetion <137953601@qq.com> Co-authored-by: chwetion <chwetion@foxmail.com> Co-authored-by: Jian.Li <74582607+leejanee@users.noreply.github.com> Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com> Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-11-09 13:06:55 +08:00
# It's a proxy for CN developer, please unblock it if you have network issue
ARG GOPROXY
Refactor: align velaux env and CLI env, they both use K8s namespace as (#2975) * Refactor: use createOrUpdateNamespace as a common util function Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Feat: add ENV webservice handelr * Fix: fix Env usecase logic * Feat: Add Delete Env API Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Fix: filter empty addon data Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Feat: split makefiels and make it clear * Feat: add k8s utils test * Feat: Add env update interface Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Feat: change env implementation Signed-off-by: barnettZQG <barnett.zqg@gmail.com> * Fix: minor fix * Revert "Fix: minor fix" This reverts commit 9cafefa65a384795315924cb18e48681dd7086a1. * Fix: use appusecase as parameter Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Refactor: align CLI vela env with new env design Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Fix: minor fix Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Feat: add page index and alias of env Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Fix: fix tests and licence header * Fix: fix makefile and add default target Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Fix: update build swagger.json Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Fix: change update env api Signed-off-by: barnettZQG <barnett.zqg@gmail.com> * Feat: list env with alias * Feat: add log to env delete * Fix: can not get app status Signed-off-by: barnettZQG <barnett.zqg@gmail.com> * Feat: support update workflow and refactor code * Fix: lint * Fix: remove swagger check Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Fix: fix cli vela delete * Fix: update test Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Fix: update test Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com> * Fix: app deploy unit test case Signed-off-by: barnettZQG <barnett.zqg@gmail.com> * Fix: SortOrderDescending is not effective Signed-off-by: barnettZQG <barnett.zqg@gmail.com> * Fix: e2e test case Signed-off-by: barnettZQG <barnett.zqg@gmail.com> * Feat: support default project/target/env * Fix: make test and add swagger * Fix: use separated datasource for unit test * Fix: app rollback bug Signed-off-by: barnettZQG <barnett.zqg@gmail.com> * Fix: fix e2e test * Fix: kubeapi driver sort bug Signed-off-by: barnettZQG <barnett.zqg@gmail.com> * Fix: e2e test * Fix: api e2e test Signed-off-by: barnettZQG <barnett.zqg@gmail.com> * Fix: e2e test fix * Fix: try fix e2e test * Fix: api e2e test Signed-off-by: barnettZQG <barnett.zqg@gmail.com> Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2021-12-25 10:36:54 +08:00
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
Feat: merge master into apiserver (#2660) * Feat(rollout): fill rolloutBatches if empty when scale up/down (#2569) * Feat: fill rolloutBatches if empty * Fix: fix unit-test * Test: add more test Fix: lint Fix: fix lint * Update release.yml (#2537) * Feat: add registry, merge registry and cap center (#2528) * Feat: add registry command * Refactor: comp/trait command combine with registry * Feat: refactor `vela comp/trait` * Fix: import * Fix: fix if type is autodetects.core.oam.dev * Fix: fix list from url * Fix: test * Feat: add test * Fix: remove dup test * Fix: test * Fix: test * Fix: fix label filter * Fix: reviewable * Fix test * fix personal repo in test * Fix test * Fix test * add some boundary check * reviewable * Fix: fix nocalhost trait (#2577) * fix incorrect addon status (#2576) * Fix(cli): client-side throttling in vela CLI (#2581) * fix cli throttling * fix import * set to a lower value * remove addon with no defs (#2574) * Feat: vela logs support multicluster (#2593) * Feat: add basic multiple cluster logs * fix context * Fix select style * Fix select style * remove useless env * fix naming * Feat: vela cluster support use ocm to join/list/detach cluster (#2599) * Feat: add render component and apply component remaining (#2587) * Feat: add render component and apply component remaining * fix ut * fix e2e * allow import package in custom status cue template (#2585) Co-authored-by: chwetion <chwetion@foxmail.com> * Fix: abnormal aux name (#2612) * Feat: store workflow step def properties in cm (#2592) * Fix: fix notification def * Feat: store workflow step def properties in cm * fix ci * fix data race * Fix: change Initializer to Application for addon Observability (#2615) In this doc, updated the Observability implementation from initializer to Application. I also store definitions as it's not well stored in vela-templates/addons/observability * Fix: fix backport param (#2611) * Fix: add owner reference in workflow context cm (#2573) * Fix: add owner reference in workflow context cm * fix ci * delete useless test case * Fix: op.delete bugs (#2622) * Fix: op.delete some bugs * Fix: app status update error Fix: make reviewable * Fix: show reconcile error log (#2626) * Feat: add reconcile timeout configuration for vela-core (#2630) * Fix: patch status retry while conflict happens (#2629) * Fix: allow definition schema cm can be same name in different definition type (#2618) * Fix: fix definition schema cm name * fix ut * fix ut * fix show * add switch default case * Feat: remove envbinding policy into workflow (#2556) Fix: add more test * Feat: add vela prob to test cluster (#2635) * Fix: upgrade stern lib to avoid panic for vela logs (#2650) * Fix: filter loggable workload in vela logs (#2651) * Fix: filter loggable workload in vela logs * reviewable * Feat: add vela exec for multi cluster (#2299) fix support vela exec * Fix: health check will check for multiclusters (#2645) * Fix: minor fix for vela cli printing (#2655) * Fix: minor fix for vela cli printing * add dockerfile go mod cache * Feat: support apiserver-related multicluster features (#2625) * Feat: remove envbinding policy into workflow Feat: add support for env change (env gc) Fix: fix rollout timeout setting bug * Feat: support disable trait and env without workflow * Fix: add hint for replaced value Co-authored-by: wyike <wangyike_wyk@163.com> Co-authored-by: basefas <basefas@hotmail.com> Co-authored-by: qiaozp <47812250+chivalryq@users.noreply.github.com> Co-authored-by: Tianxin Dong <dongtianxin.tx@alibaba-inc.com> Co-authored-by: yangsoon <yangsoonlx@gmail.com> Co-authored-by: Chwetion <137953601@qq.com> Co-authored-by: chwetion <chwetion@foxmail.com> Co-authored-by: Jian.Li <74582607+leejanee@users.noreply.github.com> Co-authored-by: Zheng Xi Zhou <zzxwill@gmail.com> Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2021-11-09 13:06:55 +08:00
2020-07-06 23:45:29 +08:00
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source for building core
COPY cmd/core/ cmd/core/
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
2020-07-06 23:45:29 +08:00
# Build
ARG TARGETARCH
ARG VERSION
ARG GITVERSION
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o manager-${TARGETARCH} cmd/core/main.go
2020-07-06 23:45:29 +08:00
# Use alpine as base image due to the discussion in issue #1448
# You can replace distroless as minimal base image to package the manager binary
2020-07-06 23:45:29 +08:00
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
FROM ${BASE_IMAGE:-alpine@sha256:f271e74b17ced29b915d351685fd4644785c6d1559dd1f2d4189a5e851ef753a}
# This is required by daemon connecting with cri
RUN apk add --no-cache ca-certificates bash expat
2020-07-06 23:45:29 +08:00
WORKDIR /
ARG TARGETARCH
COPY --from=builder /workspace/manager-${TARGETARCH} /usr/local/bin/manager
2020-07-06 23:45:29 +08:00
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["entrypoint.sh"]
CMD ["manager"]