Skip to content

Commit

Permalink
Use UBI9 base image for container build
Browse files Browse the repository at this point in the history
Change the container build to use UBI9, use createrepo_c from
pypi instead of RPM and install subscription-manager RPM to support
registration to Red Hat's content subscription service.

Signed-off-by: Brian Cook <[email protected]>
  • Loading branch information
brianwcook committed Jul 31, 2024
1 parent 6953607 commit 6c3e8a5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
FROM docker.io/library/rockylinux:9@sha256:d7be1c094cc5845ee815d4632fe377514ee6ebcf8efaed6892889657e5ddaaa6 as rockylinux9
FROM registry.access.redhat.com/ubi9/ubi@sha256:763f30167f92ec2af02bf7f09e75529de66e98f05373b88bef3c631cdcc39ad8 as ubi
FROM docker.io/library/golang:1.20.0-bullseye as golang_120
FROM docker.io/library/golang:1.21.0-bullseye as golang_121
FROM docker.io/library/node:22.3.0-bullseye as node_223

########################
# PREPARE OUR BASE IMAGE
########################
FROM rockylinux9 as base
FROM ubi as base
RUN dnf -y install \
--setopt install_weak_deps=0 \
--nodocs \
createrepo_c \
git-core \
python3 \
&& dnf clean all
libffi-devel \
subscription-manager && \
dnf clean all

######################
# BUILD/INSTALL CACHI2
Expand Down Expand Up @@ -52,6 +53,7 @@ COPY --from=builder /src/utils/merge_syft_sbom.py /usr/local/bin/merge_syft_sbom
RUN ln -s /usr/local/lib/corepack/dist/corepack.js /usr/local/bin/corepack && \
ln -s /usr/local/lib/corepack/dist/yarn.js /usr/local/bin/yarn && \
ln -s /usr/local/go/go1.21/bin/go /usr/local/bin/go && \
ln -s /venv/bin/createrepo_c /usr/local/bin/createrepo_c && \
ln -s /venv/bin/cachi2 /usr/local/bin/cachi2

ENTRYPOINT ["/usr/local/bin/cachi2"]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies = [
"setuptools",
"tomli",
"typer",
"createrepo-c",
]
[project.optional-dependencies]
dev = [
Expand Down
17 changes: 12 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --allow-unsafe --generate-hashes --output-file=requirements.txt pyproject.toml
Expand Down Expand Up @@ -96,10 +96,6 @@ annotated-types==0.7.0 \
--hash=sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53 \
--hash=sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89
# via pydantic
async-timeout==4.0.3 \
--hash=sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f \
--hash=sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028
# via aiohttp
attrs==23.2.0 \
--hash=sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30 \
--hash=sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1
Expand Down Expand Up @@ -270,6 +266,17 @@ click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via typer
createrepo-c==1.1.3 \
--hash=sha256:1d32a56940bb0930bf97993254943e4ab777b6da10ac6b3b4fc36026d5da5997 \
--hash=sha256:3e8140219e5ad95adcc3171fec2d77d84252c91ca602b7f93252cde9fa82a724 \
--hash=sha256:44018f61e5cf92e21e7554f838c81ba19cb47b13e22a6ac2b3c7bdfece26ca60 \
--hash=sha256:656e8306a9a3e78feaf1d28875491ca2496a57b9463c3055083c80175731d940 \
--hash=sha256:75db8f6ca43fd48f8bd29d2d7d6bab5f6450bafd5c017410f31ca24ee19a0edb \
--hash=sha256:a3f7cc31bf6832a42242ad50009319a12b91948bde8c267a5798fb11f8d47ed6 \
--hash=sha256:be3b655cec6d5512a2352691ef0d632cdd355319c3e1048c4dc17510f599c8a5 \
--hash=sha256:cc1881c99aca5b72ff5462d9e484c75d417ba5f5a96563cb8a8ad752f6200451 \
--hash=sha256:d90edc78281e8fd11b7d8d9dbf0951154a02cba1b5be5eeb5dd7a6a4f1c77c1c
# via cachi2 (pyproject.toml)
frozenlist==1.4.1 \
--hash=sha256:04ced3e6a46b4cfffe20f9ae482818e34eba9b5fb0ce4056e4cc9b6e212d09b7 \
--hash=sha256:0633c8d5337cb5c77acbccc6357ac49a1770b8c487e5b3505c57b949b4b82e98 \
Expand Down

0 comments on commit 6c3e8a5

Please sign in to comment.