forked from vmware-tanzu/velero
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tiger Kaovilai <[email protected]>
- Loading branch information
Showing
1 changed file
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM --platform=linux/amd64 golang:1.19-bullseye | ||
FROM --platform=$TARGETPLATFORM golang:1.19-bullseye | ||
|
||
ARG GOPROXY | ||
|
||
|
@@ -21,12 +21,12 @@ ENV GO111MODULE=on | |
ENV GOPROXY=${GOPROXY} | ||
|
||
# kubebuilder test bundle is separated from kubebuilder. Need to setup it for CI test. | ||
RUN curl -sSLo envtest-bins.tar.gz https://go.kubebuilder.io/test-tools/1.22.1/linux/amd64 && \ | ||
RUN curl -sSLo envtest-bins.tar.gz https://go.kubebuilder.io/test-tools/1.22.1/linux/$(go env GOARCH) && \ | ||
mkdir /usr/local/kubebuilder && \ | ||
tar -C /usr/local/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz | ||
|
||
RUN wget --quiet https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.2.0/kubebuilder_linux_amd64 && \ | ||
mv kubebuilder_linux_amd64 /usr/local/kubebuilder/bin/kubebuilder && \ | ||
RUN wget --quiet https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.2.0/kubebuilder_linux_$(go env GOARCH) && \ | ||
mv kubebuilder_linux_$(go env GOARCH) /usr/local/kubebuilder/bin/kubebuilder && \ | ||
chmod +x /usr/local/kubebuilder/bin/kubebuilder | ||
|
||
# get controller-tools | ||
|
@@ -39,26 +39,37 @@ RUN go install golang.org/x/tools/cmd/goimports@11e9d9cc0042e6bd10337d4d2c3e5d92 | |
# get protoc compiler and golang plugin | ||
WORKDIR /root | ||
RUN apt-get update && apt-get install -y unzip | ||
RUN wget --quiet https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protoc-3.14.0-linux-x86_64.zip && \ | ||
unzip protoc-3.14.0-linux-x86_64.zip && \ | ||
RUN if [ "$(go env GOARCH)" = "arm64" ] ; then \ | ||
wget --quiet https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protoc-3.14.0-linux-aarch_64.zip && \ | ||
unzip protoc-3.14.0-linux-aarch_64.zip; \ | ||
else \ | ||
wget --quiet https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protoc-3.14.0-linux-x86_64.zip && \ | ||
unzip protoc-3.14.0-linux-x86_64.zip; \ | ||
fi && \ | ||
rm *.zip && \ | ||
mv bin/protoc /usr/bin/protoc && \ | ||
mv include/google /usr/include && \ | ||
chmod a+x /usr/include/google && \ | ||
chmod a+x /usr/include/google/protobuf && \ | ||
chmod a+x /usr/include/google && \ | ||
chmod a+x /usr/include/google/protobuf && \ | ||
chmod a+r -R /usr/include/google && \ | ||
chmod +x /usr/bin/protoc | ||
RUN go install github.com/golang/protobuf/[email protected] | ||
|
||
# get goreleaser | ||
RUN wget --quiet https://github.com/goreleaser/goreleaser/releases/download/v1.12.3/goreleaser_Linux_x86_64.tar.gz && \ | ||
tar xvf goreleaser_Linux_x86_64.tar.gz && \ | ||
RUN if [ "$(go env GOARCH)" = "arm64" ] ; then \ | ||
wget --quiet "https://github.com/goreleaser/goreleaser/releases/download/v1.12.3/goreleaser_Linux_arm64.tar.gz" && \ | ||
tar xvf goreleaser_Linux_arm64.tar.gz; \ | ||
else \ | ||
wget --quiet "https://github.com/goreleaser/goreleaser/releases/download/v1.12.3/goreleaser_Linux_x86_64.tar.gz" && \ | ||
tar xvf goreleaser_Linux_x86_64.tar.gz; \ | ||
fi && \ | ||
mv goreleaser /usr/bin/goreleaser && \ | ||
chmod +x /usr/bin/goreleaser | ||
|
||
# get golangci-lint | ||
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.0 | ||
|
||
# install kubectl | ||
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | ||
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/$(go env GOARCH)/kubectl | ||
RUN chmod +x ./kubectl | ||
RUN mv ./kubectl /usr/local/bin |
9cff0d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
velero – ./
velero-kaovilai.vercel.app
velero-git-main-kaovilai.vercel.app
velero.vercel.app
velero.tig.pw