Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
singularity on pypi), and the versions here will coincide with these releases.

## [master](https://github.com/singularityhub/singularity-cli/tree/master)
- adding additional options to build to support singularity-compose (0.0.68)
- client should support shell (0.0.67)
- adding test for entrypoint + cmd and fixing testing requirements (0.0.66)
- fixing bug that inspect does not honor quiet (0.0.65)
Expand Down
13 changes: 9 additions & 4 deletions spython/main/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def build(self, recipe=None,
ext='sif',
sudo=True,
stream=False,
force=False):
force=False,
options=None):

'''build a singularity image, optionally for an isolated build
(requires sudo). If you specify to stream, expect the image name
Expand All @@ -44,13 +45,17 @@ def build(self, recipe=None,
name (with "image") then a fun robot name will be generated
instead. Highly recommended :)
sudo: give sudo to the command (or not) default is True for build

options: for all other options, specify them in this list.
'''
from spython.utils import check_install
check_install()

cmd = self._init_command('build')

# If no extra options
if not options:
options = []

if 'version 3' in self.version():
ext = 'sif'

Expand Down Expand Up @@ -87,10 +92,10 @@ def build(self, recipe=None,

if sandbox:
cmd.append('--sandbox')
elif sandbox:
elif writable:
cmd.append('--writable')

cmd = cmd + [image, recipe]
cmd = cmd + options + [image, recipe]

if not stream:
self._run_command(cmd, sudo=sudo, capture=False)
Expand Down