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

idea of using multi stage build instead of buildah #227

Closed
Closed
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
10 changes: 10 additions & 0 deletions Dockerfile.podman
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,21 @@ WORKDIR /go/src/
RUN CGO_ENABLED=0 \
make build

FROM almalinux:9 AS alma-dnf
RUN mkdir -p /mnt/rootfs && \
dnf install --installroot /mnt/rootfs --setopt install_weak_deps=false --releasever 9 --nodocs -y libaio libuuid numactl xfsprogs e4fsprogs nfs-utils && \
dnf --installroot /mnt/rootfs clean all && \
rm -rf /mnt/rootfs/var/cache/*

# Stage to build the driver image
FROM $BASEIMAGE AS final

# copy in the driver
COPY --from=builder /go/src/csi-isilon /

# copy in all images
COPY --from=alma-dnf /mnt/rootfs/ /

ENTRYPOINT ["/csi-isilon"]

LABEL vendor="Dell Inc." \
Expand Down
4 changes: 0 additions & 4 deletions docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ docker-build-image-push:
docker push "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)"

podman-build:
@echo "Base Image is set to: $(BASEIMAGE)"
@echo "Adding Driver dependencies to $(BASEIMAGE)"
bash ./buildubimicro.sh $(BASEIMAGE)
@echo "Base image build: SUCCESS" $(eval BASEIMAGE=localhost/csipowerscale-ubimicro:latest)
@echo "Building: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)"
$(BUILDER) build -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" -f Dockerfile.podman --target $(BUILDSTAGE) --build-arg GOPROXY=$(GOPROXY) --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOVERSION=$(GOVERSION) .

Expand Down
Loading