-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use common CSM baseimage #271
Draft
EvgenyUglov
wants to merge
10
commits into
main
Choose a base branch
from
usr/evgeny/csm-base-image
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
949ff18
Use CSM baseimage
EvgenyUglov e12b28e
Add --pull
EvgenyUglov b1382e9
Add ARG BASEIMAGE
EvgenyUglov a1997ad
Fixing lint issues
EvgenyUglov 68c42b3
Fixing lint issues
EvgenyUglov 257bf0c
Fixing lint issues
EvgenyUglov fdbe502
Remove build script
EvgenyUglov 922eb9c
docker target changes
EvgenyUglov f6dccb9
Copy licenses
EvgenyUglov b9e5791
Remove Dockerfile.podman
EvgenyUglov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,20 +1,38 @@ | ||
# Dockerfile to build Unity CSI Driver | ||
FROM centos:7.6.1810 | ||
ARG GOIMAGE | ||
ARG BASEIMAGE | ||
ARG GOPROXY | ||
|
||
# Stage to build the driver | ||
FROM $GOIMAGE as builder | ||
RUN mkdir -p /go/src | ||
COPY ./ /go/src/csi-unity | ||
|
||
# dependencies, following by cleaning the cache | ||
RUN yum install -y e2fsprogs xfsprogs which nfs-utils device-mapper-multipath \ | ||
&& \ | ||
yum clean all \ | ||
&& \ | ||
rm -rf /var/cache/run | ||
WORKDIR /go/src/csi-unity | ||
RUN mkdir -p bin | ||
RUN go generate | ||
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -ldflags '-extldflags "-static"' -o bin/csi-unity | ||
# Print the version | ||
RUN go run core/semver/semver.go -f mk | ||
|
||
# validate some cli utilities are found | ||
RUN which mkfs.ext4 | ||
RUN which mkfs.xfs | ||
|
||
COPY "bin/csi-unity" / | ||
COPY "scripts/run.sh" / | ||
# Dockerfile to build Unity CSI Driver | ||
# Fetching the base ubi micro image with the require packges committed using buildah | ||
FROM $BASEIMAGE as driver | ||
|
||
COPY --from=builder /go/src/csi-unity/bin/csi-unity / | ||
COPY scripts/run.sh / | ||
RUN chmod 777 /run.sh | ||
ENTRYPOINT ["/run.sh"] | ||
|
||
# final stage | ||
FROM driver as final | ||
|
||
ENTRYPOINT ["/run.sh"] | ||
LABEL vendor="Dell Technologies" \ | ||
maintainer="Dell Technologies" \ | ||
name="csi-unity" \ | ||
summary="CSI Driver for Dell Unity XT" \ | ||
description="CSI Driver for provisioning persistent storage from Dell Unity XT" \ | ||
release="1.13.0" \ | ||
version="2.13.0" \ | ||
license="Apache-2.0" | ||
COPY licenses /licenses |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,6 +7,10 @@ ifneq (on,$(GO111MODULE)) | |
export GO111MODULE := on | ||
endif | ||
|
||
IMAGE_NAME=csi-unity | ||
IMAGE_REGISTRY=dellemc | ||
IMAGE_TAG=$(shell date +%Y%m%d%H%M%S) | ||
|
||
.PHONY: go-vendor | ||
go-vendor: | ||
go mod vendor | ||
|
@@ -40,25 +44,20 @@ download-csm-common: | |
# Generates the docker container (but does not push) | ||
podman-build: download-csm-common go-build | ||
$(eval include csm-common.mk) | ||
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) | ||
|
||
podman-push: download-csm-common go-build | ||
$(eval include csm-common.mk) | ||
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --push | ||
podman build --pull -t $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOPROXY=$(GOPROXY) . --format=docker | ||
|
||
podman-build-no-cache: download-csm-common go-build | ||
$(eval include csm-common.mk) | ||
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --no-cache | ||
podman build --pull --no-cache -t $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOPROXY=$(GOPROXY) . --format=docker | ||
|
||
podman-no-cachepush: download-csm-common go-build | ||
$(eval include csm-common.mk) | ||
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --push --no-cache | ||
podman-push: | ||
podman push $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG) | ||
|
||
# | ||
# Docker-related tasks | ||
# | ||
# Generates the docker container (but does not push) | ||
docker-build: go-build | ||
docker-build: download-csm-common go-build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the go-build still needed since the build is being done in the Docker image build? |
||
cd core && go generate | ||
go run core/semver/semver.go -f mk >semver.mk | ||
make -f docker.mk docker-build | ||
|
@@ -69,7 +68,7 @@ docker-push: | |
version: | ||
go generate | ||
go run core/semver/semver.go -f mk >semver.mk | ||
sh build.sh -h | ||
make -f docker.mk version | ||
|
||
.PHONY: clean | ||
clean: | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is the go-build still needed since the build is being done in the Docker image build?