Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ libnvidia-container-tools
With Docker:
```bash
# Generate docker images for a supported <os><version>
make {ubuntu18.04, ubuntu16.04, debian10, debian9, centos7, amazonlinux2, opensuse-leap15.1}
make {ubuntu18.04, ubuntu16.04, debian10, debian9, centos7, amazonlinux2, opensuse-leap15.1, opensuse-leap15.6, opensuse-leap16.0, sles15.7, sles16.0}

# Or generate docker images for all supported distributions in the dist/ directory
make docker
Expand Down
11 changes: 8 additions & 3 deletions mk/Dockerfile.opensuse-leap
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ FROM ${BASEIMAGE}
SHELL ["/bin/bash", "-c"]

RUN zypper install -y \
bmake \
bzip2 \
createrepo \
createrepo_c \
curl \
gcc \
git \
Expand All @@ -18,11 +17,17 @@ RUN zypper install -y \
make \
lsb-release \
pkg-config \
rpcgen \
rpm-build \
rpmlint \
which && \
rm -rf /var/cache/zypp/*

# bmake is only needed to build the bundled elftoolchain (WITH_LIBELF=no) and rpmlint is
# optional. Neither is available in every SUSE repository (e.g. SLE BCI 16), so they are
# installed when the repository provides them.
RUN (zypper install -y bmake rpmlint || zypper install -y bmake || true) && \
rm -rf /var/cache/zypp/*

ARG OS_ARCH
ARG GOLANG_VERSION
ENV OS_ARCH=${OS_ARCH}
Expand Down
16 changes: 14 additions & 2 deletions mk/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ include $(CURDIR)/versions.mk

# Supported OSs by architecture
AMD64_TARGETS := ubuntu22.04 ubuntu20.04 ubuntu18.04 ubuntu16.04 debian10 debian9
X86_64_TARGETS := centos7 centos8 rhel7 rhel8 amazonlinux2 opensuse-leap15.1
X86_64_TARGETS := centos7 centos8 rhel7 rhel8 amazonlinux2 opensuse-leap15.1 opensuse-leap15.6 opensuse-leap16.0 sles15.7 sles16.0
PPC64LE_TARGETS := ubuntu18.04 ubuntu16.04 centos7 centos8 rhel7 rhel8
ARM64_TARGETS := ubuntu18.04
AARCH64_TARGETS := centos7 rhel7 centos8 rhel8 amazonlinux2
AARCH64_TARGETS := centos7 rhel7 centos8 rhel8 amazonlinux2 opensuse-leap15.6 opensuse-leap16.0 sles15.7 sles16.0

# Define top-level build targets
docker%: SHELL:=/bin/bash
Expand Down Expand Up @@ -145,6 +145,18 @@ docker-amd64-verify: $(patsubst %, %-verify, $(AMD64_TARGETS)) \
# private opensuse-leap target with overrides
--opensuse-leap%: OS := opensuse-leap
--opensuse-leap%: BASEIMAGE = opensuse/leap:$(VERSION)
# glibc no longer ships the Sun RPC headers from Leap 15.6 on; build against libtirpc
--opensuse-leap15.6%: WITH_TIRPC = yes
--opensuse-leap16%: WITH_TIRPC = yes

# private sles target (built on the SLE Base Container Image with the opensuse-leap Dockerfile)
--sles%: OS := opensuse-leap
--sles%: VERSION = $(patsubst sles%-$(ARCH),%,$(TARGET_PLATFORM))
--sles%: BASEIMAGE = registry.suse.com/bci/bci-base:$(VERSION)
--sles%: BUILDIMAGE = $(IMAGE_PREFIX)nvidia/$(LIB_NAME)/sles$(VERSION)-$(ARCH)
--sles%: ARTIFACTS_DIR = $(DIST_DIR)/sles$(VERSION)/$(ARCH)
--sles%: WITH_TIRPC = yes
--sles16%: WITH_LIBELF = yes

# private rhel target (actually built on centos)
--rhel%: OS := centos
Expand Down
3 changes: 2 additions & 1 deletion mk/libtirpc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ LIBTIRPC := $(SRCS_DIR)/libtirpc
##### Flags definitions #####

export CPPFLAGS := -D_FORTIFY_SOURCE=2
export CFLAGS := -O2 -g -fdata-sections -ffunction-sections -fstack-protector -fno-strict-aliasing -fPIC
# libtirpc 1.3.2 has unprototyped declarations that C23 (the GCC 15 default) rejects.
export CFLAGS := -std=gnu11 -O2 -g -fdata-sections -ffunction-sections -fstack-protector -fno-strict-aliasing -fPIC

##### Private rules #####

Expand Down
4 changes: 3 additions & 1 deletion pkg/rpm/SPECS/libnvidia-container.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ containers leveraging NVIDIA hardware. The implementation relies on several
kernel subsystems and is designed to be agnostic of the container runtime.

%install
DESTDIR=%{buildroot} %{__make} install prefix=%{_prefix} exec_prefix=%{_exec_prefix} bindir=%{_bindir} libdir=%{_libdir} includedir=%{_includedir} docdir=%{_licensedir}
# rpm >= 4.20 runs the install section in a per-build subdirectory, so point make at the
# source tree that the Makefile links to _topdir/BUILD.
DESTDIR=%{buildroot} %{__make} -C %{_topdir}/BUILD install prefix=%{_prefix} exec_prefix=%{_exec_prefix} bindir=%{_bindir} libdir=%{_libdir} includedir=%{_includedir} docdir=%{_licensedir}

%package -n %{name}%{_major}
Summary: NVIDIA container runtime library
Expand Down