From 24adaf5bf4f200ac56cae71a20cb10accfd4b0a8 Mon Sep 17 00:00:00 2001 From: Kumar Yadav Date: Fri, 26 May 2023 13:49:59 +0530 Subject: [PATCH 1/2] Dockerfile for building the image using ubi-micro --- Makefile | 6 ++--- docker-files/Dockerfile.centos | 4 ++-- docker-files/Dockerfile.ubi | 4 ++-- docker-files/Dockerfile.ubi.alt | 4 ++-- docker-files/Dockerfile.ubi.micro | 37 +++++++++++++++++++++++++++++++ docker-files/Dockerfile.ubi.min | 4 ++-- docker.mk | 4 ++-- 7 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 docker-files/Dockerfile.ubi.micro diff --git a/Makefile b/Makefile index e8e361e..47b3937 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # # -# Copyright © 2022 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright © 2022 - 2023 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,10 +16,10 @@ NAME:=csi-metadata-retriever -# Dockerfile defines which base image to use [Dockerfile.centos, Dockerfile.ubi, Dockerfile.ubi.min, Dockerfile.ubi.alt] +# Dockerfile defines which base image to use [Dockerfile.centos, Dockerfile.ubi, Dockerfile.ubi.min, Dockerfile.ubi.alt, Dockerfile.ubi.micro] # e.g.:$ make docker DOCKER_FILE=Dockerfile.ubi.alt ifndef DOCKER_FILE - DOCKER_FILE = Dockerfile.ubi.min + DOCKER_FILE = Dockerfile.ubi.micro endif # Tag parameters diff --git a/docker-files/Dockerfile.centos b/docker-files/Dockerfile.centos index 8d868de..a63680d 100644 --- a/docker-files/Dockerfile.centos +++ b/docker-files/Dockerfile.centos @@ -1,6 +1,6 @@ # # -# Copyright © 2022 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright © 2022 - 2023 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ LABEL vendor="Dell Inc." \ name="csi-metadata-retriever" \ summary="CSI Metadata Retriever sidecar" \ description="CSI Metadata Retriever sidecar for metadata retrievel via kubeapi" \ - version="1.1.0" \ + version="1.4.0" \ license="Apache-2.0" COPY licenses /licenses diff --git a/docker-files/Dockerfile.ubi b/docker-files/Dockerfile.ubi index c747559..11a5a7a 100644 --- a/docker-files/Dockerfile.ubi +++ b/docker-files/Dockerfile.ubi @@ -1,6 +1,6 @@ # # -# Copyright © 2022 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright © 2022 - 2023 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ LABEL vendor="Dell Inc." \ name="csi-metadata-retriever" \ summary="CSI Metadata Retriever sidecar" \ description="CSI Metadata Retriever sidecar for metadata retrievel via kubeapi" \ - version="1.3.0" \ + version="1.4.0" \ license="Apache-2.0" COPY licenses /licenses diff --git a/docker-files/Dockerfile.ubi.alt b/docker-files/Dockerfile.ubi.alt index 0e49765..27c1a3f 100644 --- a/docker-files/Dockerfile.ubi.alt +++ b/docker-files/Dockerfile.ubi.alt @@ -1,6 +1,6 @@ # # -# Copyright © 2022 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright © 2022 - 2023 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ LABEL vendor="Dell Inc." \ name="csi-metadata-retriever" \ summary="CSI Metadata Retriever sidecar" \ description="CSI Metadata Retriever sidecar for metadata retrievel via kubeapi" \ - version="1.3.0" \ + version="1.4.0" \ license="Apache-2.0" COPY licenses /licenses diff --git a/docker-files/Dockerfile.ubi.micro b/docker-files/Dockerfile.ubi.micro new file mode 100644 index 0000000..d573246 --- /dev/null +++ b/docker-files/Dockerfile.ubi.micro @@ -0,0 +1,37 @@ +# +# +# Copyright © 2023 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# Dockerfile to build CSI Metadata Retriever sidecar +# based on UBI-micro image +# Requires: RHEL host with subscription +# UBI Image: ubi8/ubi-micro:8.7-8 +FROM registry.access.redhat.com/ubi8/ubi-micro:8.7-8 + +LABEL vendor="Dell Inc." \ + name="csi-metadata-retriever" \ + summary="CSI Metadata Retriever sidecar" \ + description="CSI Metadata Retriever sidecar for metadata retrievel via kubeapi" \ + version="1.4.0" \ + license="Apache-2.0" + +COPY licenses /licenses + +# dependencies, following by cleaning the cache +RUN microdnf update -y \ + && \ + microdnf clean all + +COPY "csi-metadata-retriever" . +ENTRYPOINT ["/csi-metadata-retriever"] diff --git a/docker-files/Dockerfile.ubi.min b/docker-files/Dockerfile.ubi.min index e233a01..86e8b42 100644 --- a/docker-files/Dockerfile.ubi.min +++ b/docker-files/Dockerfile.ubi.min @@ -1,6 +1,6 @@ # # -# Copyright © 2022 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright © 2022- 2023 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ LABEL vendor="Dell Inc." \ name="csi-metadata-retriever" \ summary="CSI Metadata Retriever sidecar" \ description="CSI Metadata Retriever sidecar for metadata retrievel via kubeapi" \ - version="1.3.0" \ + version="1.4.0" \ license="Apache-2.0" COPY licenses /licenses diff --git a/docker.mk b/docker.mk index 6fff22e..bc25034 100644 --- a/docker.mk +++ b/docker.mk @@ -1,6 +1,6 @@ # # -# Copyright © 2022 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright © 2022 - 2023 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ ifndef DOCKER_IMAGE_NAME endif ifndef BASEIMAGE - BASEIMAGE=ubi-minimal:8.7-1085 + BASEIMAGE=registry.access.redhat.com/ubi8/ubi-micro:8.7-8 endif # figure out if podman or docker should be used (use podman if found) From d6fb265e804dd7097e6f97471976c5c91a3260cb Mon Sep 17 00:00:00 2001 From: Kumar Yadav Date: Mon, 29 May 2023 12:16:51 +0530 Subject: [PATCH 2/2] Remove unnecessary code --- docker-files/Dockerfile.ubi.micro | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docker-files/Dockerfile.ubi.micro b/docker-files/Dockerfile.ubi.micro index d573246..13be056 100644 --- a/docker-files/Dockerfile.ubi.micro +++ b/docker-files/Dockerfile.ubi.micro @@ -27,11 +27,5 @@ LABEL vendor="Dell Inc." \ license="Apache-2.0" COPY licenses /licenses - -# dependencies, following by cleaning the cache -RUN microdnf update -y \ - && \ - microdnf clean all - COPY "csi-metadata-retriever" . ENTRYPOINT ["/csi-metadata-retriever"]