Skip to content
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

Update ubi micro as the base image #149

Merged
merged 6 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions Dockerfile.podman
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,16 @@ RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -ldflags '-extldflags "-stati
# Print the version
RUN go run core/semver/semver.go -f mk


# Dockerfile to build Unity CSI Driver
# Tag corresponding to digest ab03679e683010d485ef0399e056b09a38d7843ba4a36ee7dec337dd0037f7a7 is 8.7-1085
FROM registry.access.redhat.com/ubi8/ubi-minimal@sha256:ab03679e683010d485ef0399e056b09a38d7843ba4a36ee7dec337dd0037f7a7 as driver
# dependencies, following by cleaning the cache
RUN microdnf update -y \
&& \
microdnf install -y e2fsprogs xfsprogs nfs-utils device-mapper-multipath hostname \
&& \
microdnf clean all \
&& \
rm -rf /var/cache/run
# Fetching the base ubi micro image with the require packges committed using buildah
FROM localhost/csiunity-ubimicro as driver

COPY --from=builder /go/src/csi-unity/bin/csi-unity /
COPY csi-unity/scripts/run.sh /
RUN chmod 777 /run.sh
ENTRYPOINT ["/run.sh"]

RUN microdnf install -y tar

# final stage
FROM driver as final

Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function git_version {
}

function build_image {
bash build_ubi_micro.sh registry.access.redhat.com/ubi8/ubi-micro
echo $BUILDCMD build -t ${IMAGE_NAME}:${IMAGE_TAG} .
(cd .. && $BUILDCMD build -t ${IMAGE_NAME}:${IMAGE_TAG} --build-arg GOPROXY=$GOPROXY -f csi-unity/Dockerfile.podman . --format=docker)
echo $BUILDCMD tag ${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_REPO}/${IMAGE_REPO_NAMESPACE}/${IMAGE_NAME}:${IMAGE_TAG}
Expand Down
7 changes: 7 additions & 0 deletions build_ubi_micro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
microcontainer=$(buildah from $1)
micromount=$(buildah mount $microcontainer)
dnf install --installroot $micromount --releasever=8 --nodocs --setopt install_weak_deps=false --setopt=reposdir=/etc/yum.repos.d/ e2fsprogs which xfsprogs nfs-utils device-mapper-multipath util-linux hostname -y
dnf clean all --installroot $micromount
buildah umount $microcontainer
buildah commit $microcontainer csiunity-ubimicro