Copyright 2022,2023 Nvidia Corporation. All rights reserved.
There are a few ways to build using DUE.
This is the expected use case if you are debugging a build.
--mount-dir command to have the
container mount it.)In this case, you'll invoke commands that run inside the container
that do the build.
This is the expected use case for code that you know builds, or
automated build environments.
Tip Use the
--run-image image-name:image-tag argument to skip the image
selection menu if you already know which image and tag you want to
run.
There are two options for running build commands in the container:
--command option, which allows for very specific
invocations.--command in the container.due --run --command ls -l \; pwd/usr/local/bin/duebuild in
the container.The duebuild script provides the opportunity to simplify
build configuration by performing default steps and allowing the user to
just specify the optional ones.
Each type of container will have its own version of this script. For
example, Debian based containers will default to building .deb packages,
while Red Hat or SUSE container's version of duebuild will build .rpm
packages.
There are two expected arguments and behaviors from the
duebuild script:
--default - The script will try to do a
build of the target with default settings. This can be as simple as
'make all' or 'dpkg-buildpackage -uc -us', or more involved. The end
goal is to produce a binary that showcases the software without user the
user making decisions, if at all possible.
--cbuild <args> This takes the
rest of the command line as
As build requirements may vary, other options may be present in the
duebuild script to prepare the build environment, or post process the
output. For example, the user might want to change the version of a
Debian package build to have a development string in it, or skip running
tests if they are doing debug builds. The duebuild script is a
convenient place to handle this complexity. See the existing duebuild
scripts under the templates directory for examples of
this.
due --run --command sudo mk-build-deps --install --remove ./debian/control --tool "apt-get -y" ; dpkg-buildpackage -uc -us
due --run --build --default
due --run --build --cbuild -uc -us
or
due --run --build --cbuild -uc -b -j8
due --run --command sudo mk-build-deps --install --remove ./debian/control --tool "apt-get -y" ; dpkg-buildpackage -uc -b -j8
due --run --build --default -b -j8 Unrecognized option [ -b ].
Exiting
ERROR - /usr/local/bin/duebuild [ --default -b -j8 ] failed with return
code [ 1 ]
( Fails because default does not take other arguments, and would also
still be supplying the '-us' anyway)
--run-image.--build.--cbuild.due --run-image due-pkg-fedora-36-amd64:pkg-fedora-36-amd64 --build --cbuild ncdu-1.17-1.fc36.src.rpm