Skip to content

Commit

Permalink
Update ubi micro as the base image (#149)
Browse files Browse the repository at this point in the history
* Updating base image as micro image
  • Loading branch information
rajendraindukuri authored May 30, 2023
1 parent 8f3facf commit 576829d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
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

0 comments on commit 576829d

Please sign in to comment.