Skip to content

Commit beb4894

Browse files
Niclas SchadMichaelEischer
authored andcommitted
move cinder-csi-plugin to the bottom of Dockerfile to fix our broken concourse
Signed-off-by: Niclas Schad <[email protected]>
1 parent 20363a4 commit beb4894

File tree

1 file changed

+46
-43
lines changed

1 file changed

+46
-43
lines changed

Dockerfile

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -103,49 +103,6 @@ LABEL name="barbican-kms-plugin" \
103103

104104
CMD ["sh", "-c", "/bin/barbican-kms-plugin --socketpath ${socketpath} --cloud-config ${cloudconfig}"]
105105

106-
##
107-
## cinder-csi-plugin
108-
##
109-
110-
# step 1: copy all necessary files from Debian distro to /dest folder
111-
# all magic heppens in tools/csi-deps.sh
112-
FROM --platform=${TARGETPLATFORM} ${DEBIAN_IMAGE} as cinder-csi-plugin-utils
113-
114-
RUN clean-install bash rsync mount udev btrfs-progs e2fsprogs xfsprogs
115-
COPY tools/csi-deps.sh /tools/csi-deps.sh
116-
RUN /tools/csi-deps.sh
117-
118-
# step 2: check if all necessary files are copied and work properly
119-
# the build have to finish without errors, but the result image will not be used
120-
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as cinder-csi-plugin-utils-check
121-
122-
COPY --from=cinder-csi-plugin-utils /dest /
123-
COPY --from=cinder-csi-plugin-utils /bin/sh /bin/sh
124-
COPY tools/csi-deps-check.sh /tools/csi-deps-check.sh
125-
126-
SHELL ["/bin/sh"]
127-
RUN /tools/csi-deps-check.sh
128-
129-
# step 3: build tiny cinder-csi-plugin image with only necessary files
130-
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as cinder-csi-plugin
131-
132-
# Copying csi-deps-check.sh simply ensures that the resulting image has a dependency
133-
# on cinder-csi-plugin-utils-check and therefore that the check has passed
134-
COPY --from=cinder-csi-plugin-utils-check /tools/csi-deps-check.sh /bin/csi-deps-check.sh
135-
COPY --from=cinder-csi-plugin-utils /dest /
136-
COPY --from=builder /build/cinder-csi-plugin /bin/cinder-csi-plugin
137-
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
138-
139-
LABEL name="cinder-csi-plugin" \
140-
license="Apache Version 2.0" \
141-
maintainers="Kubernetes Authors" \
142-
description="Cinder CSI Plugin" \
143-
distribution-scope="public" \
144-
summary="Cinder CSI Plugin" \
145-
help="none"
146-
147-
CMD ["/bin/cinder-csi-plugin"]
148-
149106
##
150107
## k8s-keystone-auth
151108
##
@@ -222,3 +179,49 @@ LABEL name="octavia-ingress-controller" \
222179
help="none"
223180

224181
CMD ["/bin/octavia-ingress-controller"]
182+
183+
## SKE: Concourse only pushes the last built image. Therefore we have to move this to the bottom.
184+
##
185+
## cinder-csi-plugin
186+
##
187+
188+
# step 1: copy all necessary files from Debian distro to /dest folder
189+
# all magic heppens in tools/csi-deps.sh
190+
FROM --platform=${TARGETPLATFORM} ${DEBIAN_IMAGE} as cinder-csi-plugin-utils
191+
192+
RUN clean-install bash rsync mount udev btrfs-progs e2fsprogs xfsprogs
193+
COPY tools/csi-deps.sh /tools/csi-deps.sh
194+
RUN /tools/csi-deps.sh
195+
196+
# step 2: check if all necessary files are copied and work properly
197+
# the build have to finish without errors, but the result image will not be used
198+
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as cinder-csi-plugin-utils-check
199+
200+
COPY --from=cinder-csi-plugin-utils /dest /
201+
COPY --from=cinder-csi-plugin-utils /bin/sh /bin/sh
202+
COPY tools/csi-deps-check.sh /tools/csi-deps-check.sh
203+
204+
SHELL ["/bin/sh"]
205+
RUN /tools/csi-deps-check.sh
206+
207+
# step 3: build tiny cinder-csi-plugin image with only necessary files
208+
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as cinder-csi-plugin
209+
210+
# Copying csi-deps-check.sh simply ensures that the resulting image has a dependency
211+
# on cinder-csi-plugin-utils-check and therefore that the check has passed
212+
COPY --from=cinder-csi-plugin-utils-check /tools/csi-deps-check.sh /bin/csi-deps-check.sh
213+
COPY --from=cinder-csi-plugin-utils /dest /
214+
COPY --from=builder /build/cinder-csi-plugin /bin/cinder-csi-plugin
215+
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
216+
217+
LABEL name="cinder-csi-plugin" \
218+
license="Apache Version 2.0" \
219+
maintainers="Kubernetes Authors" \
220+
description="Cinder CSI Plugin" \
221+
distribution-scope="public" \
222+
summary="Cinder CSI Plugin" \
223+
help="none"
224+
225+
CMD ["/bin/cinder-csi-plugin"]
226+
227+
##

0 commit comments

Comments
 (0)