Skip to content

Commit 01e050e

Browse files
committed
RHAIENG-287: fix(Dockerfiles): use FROM stage alias to avoid Hadolint DL3022 warning
``` `FROM` alias ./runtimes/tensorflow/ubi9-python-3.12/Dockerfile.cuda:23 DL3022 warning: `COPY --from` should reference a previously defined `FROM` alias ./runtimes/minimal/ubi9-python-3.12/Dockerfile.cpu:19 DL3022 warning: `COPY --from` should reference a previously defined `FROM` alias ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:21 DL3022 warning: `COPY --from` should reference a previously defined `FROM` alias ./runtimes/rocm-pytorch/ubi9-python-3.12/Dockerfile.rocm:19 DL3022 warning: `COPY --from` should reference a previously defined `FROM` alias ./runtimes/pytorch/ubi9-python-3.12/Dockerfile.cuda:21 DL3022 warning: `COPY --from` should reference a previously defined `FROM` alias ./runtimes/rocm-tensorflow/ubi9-python-3.12/Dockerfile.rocm:19 DL3022 warning: `COPY --from` should reference a previously defined `FROM` alias ./codeserver/ubi9-python-3.12/Dockerfile.cpu:20 DL3022 warning: `COPY --from` should reference a previously defined `FROM` alias ./codeserver/ubi9-python-3.12/Dockerfile.cpu:77 DL3022 warning: `COPY --from` should reference a previously defined `FROM` alias ```
1 parent b34b062 commit 01e050e

File tree

18 files changed

+73
-19
lines changed

18 files changed

+73
-19
lines changed

codeserver/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#########################
44
ARG BASE_IMAGE
55

6+
# External image alias for UBI repository configuration
7+
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
8+
69
####################
710
# rpm-base #
811
####################
@@ -17,7 +20,7 @@ ENV HOME=/root
1720
# Inject the official UBI 9 repository configuration into the AIPCC base image.
1821
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
1922
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
20-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
23+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
2124

2225
ARG CODESERVER_SOURCE_CODE=codeserver/ubi9-python-3.12
2326

@@ -74,7 +77,7 @@ USER 0
7477
# Inject the official UBI 9 repository configuration into the AIPCC base image.
7578
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
7679
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
77-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
80+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
7881

7982
# upgrade first to avoid fixable vulnerabilities begin
8083
# Problem: The operation would result in removing the following protected packages: systemd

jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#########################
44
ARG BASE_IMAGE
55

6+
# External image alias for UBI repository configuration
7+
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
8+
69
######################################################
710
# mongocli-builder (build stage only, not published) #
811
######################################################
@@ -44,7 +47,7 @@ ARG TARGETARCH
4447
# Inject the official UBI 9 repository configuration into the AIPCC base image.
4548
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
4649
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
47-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
50+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
4851

4952
# upgrade first to avoid fixable vulnerabilities begin
5053
# Problem: The operation would result in removing the following protected packages: systemd

jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#########################
44
ARG BASE_IMAGE
55

6+
# External image alias for UBI repository configuration
7+
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
8+
69
####################
710
# cpu-base #
811
####################
@@ -16,7 +19,7 @@ USER 0
1619
# Inject the official UBI 9 repository configuration into the AIPCC base image.
1720
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
1821
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
19-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
22+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
2023

2124
# upgrade first to avoid fixable vulnerabilities begin
2225
# Problem: The operation would result in removing the following protected packages: systemd

jupyter/minimal/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ ARG TARGETARCH
55
#########################
66
ARG BASE_IMAGE
77

8+
# External image alias for UBI repository configuration
9+
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
10+
811
####################
912
# cuda-base #
1013
####################
@@ -18,7 +21,7 @@ USER 0
1821
# Inject the official UBI 9 repository configuration into the AIPCC base image.
1922
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
2023
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
21-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
24+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
2225

2326
# upgrade first to avoid fixable vulnerabilities begin
2427
# Problem: The operation would result in removing the following protected packages: systemd

jupyter/minimal/ubi9-python-3.12/Dockerfile.rocm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#########################
44
ARG BASE_IMAGE
55

6+
# External image alias for UBI repository configuration
7+
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
8+
69
####################
710
# rocm-base #
811
####################
@@ -16,7 +19,7 @@ USER 0
1619
# Inject the official UBI 9 repository configuration into the AIPCC base image.
1720
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
1821
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
19-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
22+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
2023

2124
# upgrade first to avoid fixable vulnerabilities begin
2225
# Problem: The operation would result in removing the following protected packages: systemd

jupyter/pytorch+llmcompressor/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ ARG TARGETARCH
55
#########################
66
ARG BASE_IMAGE
77

8+
# External image alias for UBI repository configuration
9+
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
10+
811
######################################################
912
# mongocli-builder (build stage only, not published) #
1013
######################################################
@@ -31,7 +34,7 @@ USER 0
3134
# Inject the official UBI 9 repository configuration into the AIPCC base image.
3235
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
3336
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
34-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
37+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
3538

3639
# upgrade first to avoid fixable vulnerabilities begin
3740
# Problem: The operation would result in removing the following protected packages: systemd

jupyter/pytorch/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ ARG TARGETARCH
55
#########################
66
ARG BASE_IMAGE
77

8+
# External image alias for UBI repository configuration
9+
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
10+
811
######################################################
912
# mongocli-builder (build stage only, not published) #
1013
######################################################
@@ -31,7 +34,7 @@ USER 0
3134
# Inject the official UBI 9 repository configuration into the AIPCC base image.
3235
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
3336
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
34-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
37+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
3538

3639
# upgrade first to avoid fixable vulnerabilities begin
3740
# Problem: The operation would result in removing the following protected packages: systemd

jupyter/rocm/pytorch/ubi9-python-3.12/Dockerfile.rocm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#########################
44
ARG BASE_IMAGE
55

6+
# External image alias for UBI repository configuration
7+
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
8+
69
######################################################
710
# mongocli-builder (build stage only, not published) #
811
######################################################
@@ -29,7 +32,7 @@ USER 0
2932
# Inject the official UBI 9 repository configuration into the AIPCC base image.
3033
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
3134
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
32-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
35+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
3336

3437
# upgrade first to avoid fixable vulnerabilities begin
3538
# Problem: The operation would result in removing the following protected packages: systemd

jupyter/rocm/tensorflow/ubi9-python-3.12/Dockerfile.rocm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#########################
44
ARG BASE_IMAGE
55

6+
# External image alias for UBI repository configuration
7+
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
8+
69
######################################################
710
# mongocli-builder (build stage only, not published) #
811
######################################################
@@ -29,7 +32,7 @@ USER 0
2932
# Inject the official UBI 9 repository configuration into the AIPCC base image.
3033
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
3134
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
32-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
35+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
3336

3437
# upgrade first to avoid fixable vulnerabilities begin
3538
# Problem: The operation would result in removing the following protected packages: systemd

jupyter/tensorflow/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ ARG TARGETARCH
55
#########################
66
ARG BASE_IMAGE
77

8+
# External image alias for UBI repository configuration
9+
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
10+
811
######################################################
912
# mongocli-builder (build stage only, not published) #
1013
######################################################
@@ -31,7 +34,7 @@ USER 0
3134
# Inject the official UBI 9 repository configuration into the AIPCC base image.
3235
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
3336
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
34-
COPY --from=registry.access.redhat.com/ubi9/ubi /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
37+
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
3538

3639
# upgrade first to avoid fixable vulnerabilities begin
3740
# Problem: The operation would result in removing the following protected packages: systemd

0 commit comments

Comments
 (0)