-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from ucloud/v0.1.7
V0.1.7
- Loading branch information
Showing
1,505 changed files
with
165,093 additions
and
178,228 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM golang:1.13.3-alpine as go-builder | ||
|
||
ARG PROJECT_NAME=redis-operator | ||
ARG REPO_PATH=github.com/ucloud/$PROJECT_NAME | ||
ARG BUILD_PATH=${REPO_PATH}/cmd/manager | ||
|
||
# Build version and commit should be passed in when performing docker build | ||
ARG VERSION=0.1.1 | ||
ARG GIT_SHA=0000000 | ||
|
||
RUN mkdir -p /go/src/${REPO_PATH}/vendor | ||
|
||
COPY pkg /go/src/${REPO_PATH}/pkg | ||
COPY cmd /go/src/${REPO_PATH}/cmd | ||
COPY vendor /go/src/${REPO_PATH}/vendor | ||
|
||
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ${GOBIN}/${PROJECT_NAME} \ | ||
-ldflags "-X ${REPO_PATH}/pkg/version.Version=${VERSION} -X ${REPO_PATH}/pkg/version.GitSHA=${GIT_SHA}" \ | ||
$BUILD_PATH | ||
|
||
# ============================================================================= | ||
FROM alpine:3.9 AS final | ||
|
||
ARG PROJECT_NAME=redis-operator | ||
ARG REPO_PATH=github.com/ucloud/$PROJECT_NAME | ||
|
||
COPY --from=go-builder ${GOBIN}/${PROJECT_NAME} /usr/local/bin/${PROJECT_NAME} | ||
|
||
RUN adduser -D ${PROJECT_NAME} | ||
USER ${PROJECT_NAME} | ||
|
||
ENTRYPOINT ["/usr/local/bin/redis-operator"] |
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.