Packaging and Delivering Software With the Image Packaging System in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Publish the Package

Publish your package to a local file-based repository. This repository is for developing and testing this new package. If you create a repository for general use, you should include additional steps such as creating a separate file system for the repository. For information about creating package repositories for general use, see Copying and Creating Package Repositories in Oracle Solaris 11.2 .

To test the package with non-global zones, the repository location must be accessible through the system repository. Use the pkg publisher or pkg list command inside a non-global zone to confirm that the package is accessible.

Use the pkgrepo (1) command to create a repository on your system:

$ pkgrepo create my-repository
$ ls my-repository
pkg5.repository

Set the default publisher for this repository. The default publisher is the value of the publisher/prefix property of the repository.

$ pkgrepo -s my-repository set publisher/prefix=mypublisher

Use the pkgsend publish command to publish the new package. If multiple pkgsend publish processes might be publishing to the same -s repository simultaneously, specifying the --no-catalog option is recommended because updates to publisher catalogs must be performed serially. Publication performance might be significantly reduced if the --no-catalog option is not used when multiple processes are simultaneously publishing packages. After publication is complete, the new packages can be added to the respective publisher catalogs by using the pkgrepo refresh command.

$ pkgsend -s my-repository publish -d proto mypkg.p5m.4.res
pkg://mypublisher/mypkg@1.0,5.11-0:20130720T005452Z
PUBLISHED

Notice that the repository default publisher has been applied to the package FMRI.

Verify that the new repository permissions, content, and signatures are correct:

$ pkgrepo verify -s my-repository

You can use the pkgrepo and pkg list commands to examine the repository:

$ pkgrepo info -s my-repository
PUBLISHER   PACKAGES STATUS           UPDATED
mypublisher 1        online           2013-07-20T00:54:52.758591Z
$ pkgrepo list -s my-repository
PUBLISHER   NAME                    0 VERSION
mypublisher mypkg                     1.0,5.11-0:20130720T005452Z
$ pkg list -afv -g my-repository
FMRI                                                     IFO
pkg://mypublisher/mypkg@1.0,5.11-0:20130720T005452Z      ---

Publishing the new package directly to an HTTP repository is not recommended since no authorization or authentication checks are performed on the incoming package when publishing over HTTP. Instead of publishing the package to an HTTP repository, deliver the already-published package to an HTTP repository as described in Deliver to a Package Repository. Publishing to HTTP repositories can be convenient on secure networks or when testing the same package across several machines when NFS or SMB access to the file repository is not possible. If you publish directly to an HTTP repository, that repository must be hosted on a machine with a read/write instance of the svc:/application/pkg/server service (the value of the pkg/readonly property is false).