-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Refactor-fix-typo-on-AzureClientId-and-Azu…
…reClientSecret Signed-off-by: Le Tran <[email protected]>
- Loading branch information
Showing
113 changed files
with
2,800 additions
and
445 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
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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022 The Kanister Authors. | ||
# | ||
# 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. | ||
|
||
set -o errexit | ||
set -o nounset | ||
|
||
IMAGE_REGISTRY="ghcr.io/kanisterio" | ||
|
||
readonly COMMIT_ID=${1:?"Commit id to build kopia image not specified"} | ||
readonly KOPIA_REPO_ORG=${2-:"kopia"} | ||
readonly IMAGE_TYPE=alpine | ||
readonly IMAGE_BUILD_VERSION="${COMMIT_ID}" | ||
readonly GH_PACKAGE_TARGET="${IMAGE_REGISTRY}/kopia" | ||
readonly TAG="${IMAGE_TYPE}-${IMAGE_BUILD_VERSION}" | ||
|
||
|
||
docker build \ | ||
--tag "${GH_PACKAGE_TARGET}:${TAG}" \ | ||
--build-arg "kopiaBuildCommit=${COMMIT_ID}" \ | ||
--build-arg "kopiaRepoOrg=${KOPIA_REPO_ORG}" \ | ||
--file ./docker/kopia-build/Dockerfile . | ||
|
||
docker push ${GH_PACKAGE_TARGET}:$TAG |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM golang:1.19.1-alpine3.16 AS builder | ||
|
||
ARG kopiaBuildCommit | ||
ARG kopiaRepoOrg | ||
|
||
RUN apk add git | ||
|
||
WORKDIR / | ||
|
||
RUN git clone https://github.com/${kopiaRepoOrg}/kopia.git | ||
|
||
ENV GITHUB_REPOSITORY=https://github.com/${kopiaRepoOrg}/kopia | ||
|
||
WORKDIR /kopia | ||
|
||
# Build kopia binary from specific commit | ||
RUN git checkout ${kopiaBuildCommit} | ||
# Refers to goreleaser/goreleaser:v1.11.2 | ||
COPY --from=docker.io/goreleaser/goreleaser@sha256:b13418f20019fffb29797aff3d03f5e9ca84cea93634f4169a7ed603a95ab198 \ | ||
/usr/bin/goreleaser /usr/bin/goreleaser | ||
RUN goreleaser build --output=. --rm-dist --single-target | ||
|
||
RUN adduser -D kopia && addgroup kopia kopia | ||
USER kopia:kopia | ||
|
||
COPY --chown=kopia . /kopia | ||
|
||
FROM alpine:3.16 | ||
|
||
WORKDIR /kopia | ||
|
||
# Add CA certs | ||
RUN apk add --no-cache --verbose ca-certificates && \ | ||
rm -rf /var/cache/apk/* && \ | ||
adduser -D kopia && addgroup kopia kopia && \ | ||
chown kopia /kopia | ||
|
||
USER kopia:kopia | ||
|
||
ENTRYPOINT [ "/kopia/kopia" ] | ||
|
||
LABEL imageVersion="${imageVersion}" | ||
LABEL kopiaBuildCommit="${kopiaBuildCommit}" | ||
|
||
COPY --from=builder --chown=kopia:kopia /kopia/kopia /kopia/kopia |
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
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
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
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
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
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
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
Oops, something went wrong.