Skip to content

Commit 0aef098

Browse files
authored
Merge pull request #1201 from tkatila/dockerfile-improvements
dockerfile fixes after hadolint scan
2 parents cb729f1 + e9267e4 commit 0aef098

27 files changed

+87
-91
lines changed

build/docker/intel-deviceplugin-operator.Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG CMD=operator
2525
## (see build-image.sh).
2626
## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based.
2727
## The RedHat build tool does not allow additional image build parameters.
28-
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro
28+
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest
2929
###
3030
##
3131
## GOLANG_BASE can be used to make the build reproducible by choosing an
@@ -45,8 +45,7 @@ ARG EP=/usr/local/bin/intel_deviceplugin_operator
4545
ARG CMD
4646
WORKDIR ${DIR}
4747
COPY . .
48-
RUN cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}"; cd - \
49-
&& install -D /go/bin/${CMD} /install_root${EP}
48+
RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP}
5049
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \
5150
&& if [ ! -d "licenses/$CMD" ] ; then \
5251
GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \

build/docker/intel-dlb-initcontainer.Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
## (see build-image.sh).
2525
## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based.
2626
## The RedHat build tool does not allow additional image build parameters.
27-
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro
27+
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest
2828
###
2929
##
3030
## GOLANG_BASE can be used to make the build reproducible by choosing an
@@ -42,7 +42,8 @@ COPY . .
4242
ARG TOYBOX_VERSION="0.8.8"
4343
ARG TOYBOX_SHA256="2bed6bb9edd5a249023103cf0402a835b0e53d10304a263f6f1e77a8aa49a898"
4444
ARG ROOT=/install_root
45-
RUN apt update && apt -y install musl musl-tools musl-dev
45+
RUN apt-get update && apt-get --no-install-recommends -y install musl musl-tools musl-dev
46+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4647
RUN curl -SL https://github.com/landley/toybox/archive/refs/tags/$TOYBOX_VERSION.tar.gz -o toybox.tar.gz \
4748
&& echo "$TOYBOX_SHA256 toybox.tar.gz" | sha256sum -c - \
4849
&& tar -xzf toybox.tar.gz \

build/docker/intel-dlb-plugin.Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG CMD=dlb_plugin
2525
## (see build-image.sh).
2626
## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based.
2727
## The RedHat build tool does not allow additional image build parameters.
28-
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro
28+
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest
2929
###
3030
##
3131
## GOLANG_BASE can be used to make the build reproducible by choosing an
@@ -45,8 +45,7 @@ ARG EP=/usr/local/bin/intel_dlb_device_plugin
4545
ARG CMD
4646
WORKDIR ${DIR}
4747
COPY . .
48-
RUN cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}"; cd - \
49-
&& install -D /go/bin/${CMD} /install_root${EP}
48+
RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP}
5049
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \
5150
&& if [ ! -d "licenses/$CMD" ] ; then \
5251
GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \

build/docker/intel-dsa-plugin.Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG CMD=dsa_plugin
2525
## (see build-image.sh).
2626
## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based.
2727
## The RedHat build tool does not allow additional image build parameters.
28-
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro
28+
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest
2929
###
3030
##
3131
## GOLANG_BASE can be used to make the build reproducible by choosing an
@@ -45,8 +45,7 @@ ARG EP=/usr/local/bin/intel_dsa_device_plugin
4545
ARG CMD
4646
WORKDIR ${DIR}
4747
COPY . .
48-
RUN cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}"; cd - \
49-
&& install -D /go/bin/${CMD} /install_root${EP}
48+
RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP}
5049
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \
5150
&& if [ ! -d "licenses/$CMD" ] ; then \
5251
GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \

build/docker/intel-fpga-admissionwebhook.Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG CMD=fpga_admissionwebhook
2525
## (see build-image.sh).
2626
## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based.
2727
## The RedHat build tool does not allow additional image build parameters.
28-
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro
28+
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest
2929
###
3030
##
3131
## GOLANG_BASE can be used to make the build reproducible by choosing an
@@ -45,8 +45,7 @@ ARG EP=/usr/local/bin/intel_fpga_admissionwebhook
4545
ARG CMD
4646
WORKDIR ${DIR}
4747
COPY . .
48-
RUN cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}"; cd - \
49-
&& install -D /go/bin/${CMD} /install_root${EP}
48+
RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP}
5049
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \
5150
&& if [ ! -d "licenses/$CMD" ] ; then \
5251
GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \

build/docker/intel-fpga-initcontainer.Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
## (see build-image.sh).
2525
## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based.
2626
## The RedHat build tool does not allow additional image build parameters.
27-
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro
27+
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest
2828
###
2929
##
3030
## GOLANG_BASE can be used to make the build reproducible by choosing an
@@ -45,8 +45,7 @@ ARG CMD=fpga_crihook
4545
ARG EP=/usr/local/fpga-sw/$CRI_HOOK
4646
WORKDIR ${DIR}
4747
COPY . .
48-
RUN cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}"; cd - \
49-
&& install -D /go/bin/${CMD} /install_root${EP}
48+
RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP}
5049
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \
5150
&& if [ ! -d "licenses/$CMD" ] ; then \
5251
GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \
@@ -57,8 +56,7 @@ ARG CMD=fpga_tool
5756
ARG EP=/usr/local/fpga-sw/$CMD
5857
WORKDIR ${DIR}
5958
COPY . .
60-
RUN cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}"; cd - \
61-
&& install -D /go/bin/${CMD} /install_root${EP}
59+
RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP}
6260
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \
6361
&& if [ ! -d "licenses/$CMD" ] ; then \
6462
GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \
@@ -75,7 +73,8 @@ RUN echo "{\n\
7573
ARG TOYBOX_VERSION="0.8.8"
7674
ARG TOYBOX_SHA256="2bed6bb9edd5a249023103cf0402a835b0e53d10304a263f6f1e77a8aa49a898"
7775
ARG ROOT=/install_root
78-
RUN apt update && apt -y install musl musl-tools musl-dev
76+
RUN apt-get update && apt-get --no-install-recommends -y install musl musl-tools musl-dev
77+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
7978
RUN curl -SL https://github.com/landley/toybox/archive/refs/tags/$TOYBOX_VERSION.tar.gz -o toybox.tar.gz \
8079
&& echo "$TOYBOX_SHA256 toybox.tar.gz" | sha256sum -c - \
8180
&& tar -xzf toybox.tar.gz \

build/docker/intel-fpga-plugin.Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG CMD=fpga_plugin
2525
## (see build-image.sh).
2626
## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based.
2727
## The RedHat build tool does not allow additional image build parameters.
28-
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro
28+
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest
2929
###
3030
##
3131
## GOLANG_BASE can be used to make the build reproducible by choosing an
@@ -45,8 +45,7 @@ ARG EP=/usr/local/bin/intel_fpga_device_plugin
4545
ARG CMD
4646
WORKDIR ${DIR}
4747
COPY . .
48-
RUN cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}"; cd - \
49-
&& install -D /go/bin/${CMD} /install_root${EP}
48+
RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP}
5049
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \
5150
&& if [ ! -d "licenses/$CMD" ] ; then \
5251
GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \

build/docker/intel-gpu-initcontainer.Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
## (see build-image.sh).
2525
## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based.
2626
## The RedHat build tool does not allow additional image build parameters.
27-
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro
27+
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest
2828
###
2929
##
3030
## GOLANG_BASE can be used to make the build reproducible by choosing an
@@ -46,8 +46,7 @@ ARG NFD_HOOK=intel-gpu-nfdhook
4646
ARG SRC_DIR=/usr/local/bin/gpu-sw
4747
WORKDIR ${DIR}
4848
COPY . .
49-
RUN cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}"; cd - \
50-
&& install -D /go/bin/${CMD} /install_root${EP}
49+
RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP}
5150
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \
5251
&& if [ ! -d "licenses/$CMD" ] ; then \
5352
GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \
@@ -57,7 +56,8 @@ RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-ku
5756
ARG TOYBOX_VERSION="0.8.8"
5857
ARG TOYBOX_SHA256="2bed6bb9edd5a249023103cf0402a835b0e53d10304a263f6f1e77a8aa49a898"
5958
ARG ROOT=/install_root
60-
RUN apt update && apt -y install musl musl-tools musl-dev
59+
RUN apt-get update && apt-get --no-install-recommends -y install musl musl-tools musl-dev
60+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
6161
RUN curl -SL https://github.com/landley/toybox/archive/refs/tags/$TOYBOX_VERSION.tar.gz -o toybox.tar.gz \
6262
&& echo "$TOYBOX_SHA256 toybox.tar.gz" | sha256sum -c - \
6363
&& tar -xzf toybox.tar.gz \

build/docker/intel-gpu-plugin.Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG CMD=gpu_plugin
2525
## (see build-image.sh).
2626
## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based.
2727
## The RedHat build tool does not allow additional image build parameters.
28-
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro
28+
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest
2929
###
3030
##
3131
## GOLANG_BASE can be used to make the build reproducible by choosing an
@@ -45,8 +45,7 @@ ARG EP=/usr/local/bin/intel_gpu_device_plugin
4545
ARG CMD
4646
WORKDIR ${DIR}
4747
COPY . .
48-
RUN cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}"; cd - \
49-
&& install -D /go/bin/${CMD} /install_root${EP}
48+
RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP}
5049
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \
5150
&& if [ ! -d "licenses/$CMD" ] ; then \
5251
GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \

build/docker/intel-iaa-plugin.Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG CMD=iaa_plugin
2525
## (see build-image.sh).
2626
## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based.
2727
## The RedHat build tool does not allow additional image build parameters.
28-
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro
28+
ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest
2929
###
3030
##
3131
## GOLANG_BASE can be used to make the build reproducible by choosing an
@@ -45,8 +45,7 @@ ARG EP=/usr/local/bin/intel_iaa_device_plugin
4545
ARG CMD
4646
WORKDIR ${DIR}
4747
COPY . .
48-
RUN cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}"; cd - \
49-
&& install -D /go/bin/${CMD} /install_root${EP}
48+
RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP}
5049
RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \
5150
&& if [ ! -d "licenses/$CMD" ] ; then \
5251
GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \

0 commit comments

Comments
 (0)