Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Generate RPM and support arbitrary files copied to the host #767

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions Atomic/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def ps_tty(self):
max_container_id = 12 if self.args.truncate else max([len(x.id) for x in container_objects])
max_image_name = 20 if self.args.truncate else max([len(x.image_name) for x in container_objects])
max_command = 20 if self.args.truncate else max([len(x.command) for x in container_objects])
col_out = "{0:2} {1:%s} {2:%s} {3:%s} {4:16} {5:9} {6:10} {7:10}" % (max_container_id, max_image_name, max_command)
col_out = "{0:2} {1:%s} {2:%s} {3:%s} {4:16} {5:10} {6:10} {7:10}" % (max_container_id, max_image_name, max_command)
if self.args.heading:
util.write_out(col_out.format(" ",
"CONTAINER ID",
Expand All @@ -173,7 +173,7 @@ def ps_tty(self):
con_obj.image_name[0:max_image_name],
con_obj.command[0:max_command],
con_obj.created[0:16],
con_obj.state[0:9],
con_obj.state[0:10],
con_obj.backend.backend[0:10],
con_obj.runtime[0:10]))

Expand Down
2 changes: 2 additions & 0 deletions Atomic/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def cli(subparser):
system_xor_user.add_argument("--system", dest="system",
action='store_true', default=False,
help=_('install a system container'))
installp.add_argument("--system-package", dest="system_package", default="auto",
help=_('control how to install the package. It accepts `auto`, `yes`, `no`, `build`'))
installp.add_argument("--rootfs", dest="remote",
help=_("choose an existing exploded container/image to use "
"its rootfs as a remote, read-only rootfs for the "
Expand Down
588 changes: 496 additions & 92 deletions Atomic/syscontainers.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bash/atomic
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ _atomic_install() {
--rootfs
--storage
--system
--system-package
--set
--user
"
Expand Down
13 changes: 13 additions & 0 deletions docs/atomic-install.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ atomic-install - Execute Image Install Method
[**--rootfs**=*ROOTFS*]
[**--set**=*NAME*=*VALUE*]
[**--storage**]
[**--system-package=auto|build|yes|no**]
[**--system**]
IMAGE [ARG...]

Expand Down Expand Up @@ -96,6 +97,18 @@ Note: If the image being pulled contains a label of `system.type=ostree`,
atomic will automatically substitute the storage backend to be ostree. This
can be overridden with the --storage option.

**--system-package=auto|build|no|yes**
Control how the container will be installed to the system.

*auto* generates an rpm and install it to the system when the
image defines a .spec file. This is the default.

*build* build only the software package, without installing it.

*no* do not generate an rpm package to install the container.

*yes* generate an rpm package and install it to the system.

**--user**
If running as non-root, specify to install the image from the current
OSTree repository and manage it through systemd and bubblewrap.
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_system_containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ test \! -e ${ATOMIC_OSTREE_CHECKOUT_PATH}/${NAME}
test \! -e ${ATOMIC_OSTREE_CHECKOUT_PATH}/${NAME}.0
test \! -e ${ATOMIC_OSTREE_CHECKOUT_PATH}/${NAME}.1

${ATOMIC} pull --storage ostree docker:atomic-test-secret
${ATOMIC} pull --storage ostree docker:atomic-test-secret:latest
# Move directly the OSTree reference to a new one, so that we have different names and info doesn't error out
mv ${ATOMIC_OSTREE_REPO}/refs/heads/ociimage/atomic-test-secret_3Alatest ${ATOMIC_OSTREE_REPO}/refs/heads/ociimage/atomic-test-secret-ostree_3Alatest
${ATOMIC} info atomic-test-secret-ostree > version.out
Expand Down Expand Up @@ -332,7 +332,7 @@ teardown

# Install from a docker local docker image
export NAME="test-docker-system-container-$$"
${ATOMIC} install --name=${NAME} --set=RECEIVER=${SECRET} --system docker:atomic-test-system
${ATOMIC} install --name=${NAME} --set=RECEIVER=${SECRET} --system docker:atomic-test-system:latest
test -e /etc/tmpfiles.d/${NAME}.conf

test -e ${ATOMIC_OSTREE_CHECKOUT_PATH}/${NAME}.0/${NAME}.service
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class TestAtomicPull(unittest.TestCase):
class Args():
def __init__(self):
self.image = "docker:centos"
self.image = "docker:centos:latest"
self.user = False

def test_pull_as_privileged_user(self):
Expand Down