diff options
-rw-r--r-- | docs/source/Commands.rst | 2 | ||||
-rw-r--r-- | docs/source/Introduction.rst | 106 | ||||
-rw-r--r-- | docs/source/Reference.rst | 8 | ||||
-rw-r--r-- | docs/source/Search.rst | 18 | ||||
-rw-r--r-- | docs/source/Tutorials.rst | 10 | ||||
-rw-r--r-- | docs/source/_static/api.html | 2 | ||||
-rw-r--r-- | docs/source/includes.rst | 19 | ||||
-rw-r--r-- | docs/source/index.rst | 25 | ||||
-rw-r--r-- | pkg/api/handlers/libpod/manifests.go | 1 | ||||
-rw-r--r-- | pkg/api/handlers/libpod/system.go | 10 | ||||
-rw-r--r-- | pkg/api/server/register_system.go | 14 | ||||
-rw-r--r-- | pkg/bindings/manifests/manifests.go | 6 | ||||
-rw-r--r-- | pkg/bindings/system/system.go | 13 | ||||
-rw-r--r-- | pkg/bindings/test/system_test.go | 42 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/system.go | 5 | ||||
-rw-r--r-- | test/e2e/manifest_test.go | 4 | ||||
-rw-r--r-- | test/e2e/system_reset_test.go | 2 |
17 files changed, 178 insertions, 109 deletions
diff --git a/docs/source/Commands.rst b/docs/source/Commands.rst index 028f03429..e3dbf8ecd 100644 --- a/docs/source/Commands.rst +++ b/docs/source/Commands.rst @@ -1,3 +1,5 @@ +.. include:: includes.rst + Commands ======== diff --git a/docs/source/Introduction.rst b/docs/source/Introduction.rst index c516b3317..a1f9d605e 100644 --- a/docs/source/Introduction.rst +++ b/docs/source/Introduction.rst @@ -1,2 +1,106 @@ +.. include:: includes.rst + Introduction -============ +================================== +Containers_ simplify the consumption of applications with all of their dependencies and default configuration files. Users test drive or deploy a new application with one or two commands instead of following pages of installation instructions. Here's how to find your first `Container Image`_:: + + podman search busybox + +Output:: + + INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED + docker.io docker.io/library/busybox Busybox base image. 1882 [OK] + docker.io docker.io/radial/busyboxplus Full-chain, Internet enabled, busybox made f... 30 [OK] + docker.io docker.io/yauritux/busybox-curl Busybox with CURL 8 + ... + +The previous command returned a list of publicly available container images on DockerHub. These container images are easy to consume, but of differing levels of quality and maintenance. Let’s use the first one listed because it seems to be well maintained. + +To run the busybox container image, it’s just a single command:: + + podman run -it docker.io/library/busybox + +Output:: + + / # + +You can poke around in the busybox container for a while, but you’ll quickly find that running small container with a few Linux utilities in it provides limited value, so exit out:: + + exit + +There’s an old saying that “nobody runs an operating system just to run an operating system” and the same is true with containers. It’s the workload running on top of an operating system or in a container that’s interesting and valuable. + +Sometimes we can find a publicly available container image for the exact workload we’re looking for and it will already be packaged exactly how we want. But, more often than not, there’s something that we want to add, remove, or customize. It could be as simple as a configuration setting for security or performance, or as complex as adding a complex workload. Either way, containers make it fairly easy to make the changes we need. + +Container Images aren’t actually images, they’re repositories often made up of multiple layers. These layers can easily be added, saved, and shared with others by using a Containerfile (Dockerfile). This single file often contains all the instructions needed to build the new and can easily be shared with others publicly using tools like GitHub. + +Here's an example of how to build an Nginx web server on top of a Debian base image using the Dockerfile maintained by Nginx and published in GitHub:: + + podman build -t nginx https://git.io/Jf8ol + +Once, the image build completes, it’s easy to run the new image from our local cache:: + + podman run -d -p 8080:80 nginx + curl localhost:8080 + +Output:: + + ... + <p><em>Thank you for using nginx.</em></p> + ... + +Building new images is great, but sharing our work with others let’s them review our work, critique how we built them, and offer improved versions. Our newly built Nginx image could be published at quay.io or docker.io to share it with the world. Everything needed to run the Nginx application is provided in the container image. Others could easily pull it down and use it, or make improvements to it. + +Standardizing on container images and `Container Registries`_ enable a new level of collaboration through simple consumption. This simple consumption model is possible because every major Container Engine and Registry Server uses the Open Containers Initiative (OCI_) format. This allows users to find, run, build, share and deploy containers anywhere they want. Podman and other `Container Engines`_ like CRI-O, Docker, or containerd can create and consume container images from docker.io, quay.io, an on premise registry or even one provided by a cloud provider. The OCI image format facilitates this ecosystem through a single standard. + +For example, if we wanted to share our newly built Nginx container image on quay.io it’s easy. First log in to quay:: + + podman login quay.io +Input:: + + Username: USERNAME + Password: ******** + Login Succeeded! + +Nex, tag the image so that we can push it into our user account:: + + podman tag localhost/nginx quay.io/USERNAME/nginx + +Finally, push the image:: + + podman push quay.io/USERNAME/nginx + +Output:: + + Getting image source signatures + Copying blob 38c40d6c2c85 done + Copying blob fee76a531659 done + Copying blob c2adabaecedb done + Copying config 7f3589c0b8 done + Writing manifest to image destination + Copying config 7f3589c0b8 done + Writing manifest to image destination + Storing signatures + +Notice that we pushed four layers to our registry and now it’s available for others to share. Take a quick look:: + + podman inspect quay.io/USERNAME/nginx + +Output:: + + [ + { + "Id": "7f3589c0b8849a9e1ff52ceb0fcea2390e2731db9d1a7358c2f5fad216a48263", + "Digest": "sha256:7822b5ba4c2eaabdd0ff3812277cfafa8a25527d1e234be028ed381a43ad5498", + "RepoTags": [ + "quay.io/USERNAME/nginx:latest", + ... + +To summarize, Podman makes it easy to find, run, build and share containers. + +* Find: whether finding a container on dockerhub.io or quay.io, an internal registry server, or directly from a vendor, a couple of `podman search`_, and `podman pull`_ commands make it easy +* Run: it's easy to consume pre-built images with everything needed to run an entire application, or start from a Linux distribution base image with the `podman run`_ command +* Build: creating new layers with small tweaks, or major overhauls is easy with `podman build` +* Share: Podman let’s you push your newly built containers anywhere you want with a single `podman push`_ command + +For more instructions on use cases, take a look at our :doc:`Tutorials` page. diff --git a/docs/source/Reference.rst b/docs/source/Reference.rst index c6a131bc7..d194c55a3 100644 --- a/docs/source/Reference.rst +++ b/docs/source/Reference.rst @@ -1,4 +1,10 @@ +.. include:: includes.rst + Reference ========= -Check out our new in-development `API documentation <_static/api.html>`_ +To see full screen version please visit: `API documentation <https://docs.podman.io/en/latest/_static/api.html>`_ + +.. raw:: html + + <iframe src="_static/api.html" allowfullscreen="true" height="600px" width="120%"></iframe> diff --git a/docs/source/Search.rst b/docs/source/Search.rst new file mode 100644 index 000000000..a80c229f4 --- /dev/null +++ b/docs/source/Search.rst @@ -0,0 +1,18 @@ +.. include:: includes.rst + +Search +================================== + +.. raw:: html + + <p> + From here you can search these documents. Enter your search + words into the box below and click "search". Note that the search + function will automatically search for all of the words. Pages + containing fewer words won't appear in the result list. + </p> + <form action="/en/latest/search.html" method="get" _lpchecked="1"> + <input type="text" name="q" value=""> + <input type="submit" value="search"> + <span id="search-progress" style="padding-left: 10px"></span> + </form> diff --git a/docs/source/Tutorials.rst b/docs/source/Tutorials.rst index 85ae59131..0c013c244 100644 --- a/docs/source/Tutorials.rst +++ b/docs/source/Tutorials.rst @@ -1,4 +1,12 @@ +.. include:: includes.rst + Tutorials ========= +Here are a number of useful tutorials to get you up and running with Podman. If you are familiar with the Docker `Container Engine`_ the command in Podman_ should be quite familiar. If are brand new to containers, take a look at our `Introduction`. -`Podman Tutorials on GitHub <https://github.com/containers/libpod/tree/master/docs/tutorials>`_ +* `Basic Setup and Use of Podman <https://github.com/containers/libpod/blob/master/docs/tutorials/podman_tutorial.md>`_: Learn how to setup Podman and perform some basic commands with the utility. +* `Basic Setup and Use of Podman in a Rootless environment <https://github.com/containers/libpod/blob/master/docs/tutorials/rootless_tutorial.md>`_: The steps required to setup rootless Podman are enumerated. +* `Podman Mac Client tutorial <https://github.com/containers/libpod/blob/master/docs/tutorials/mac_client.md>`_: Special setup for running the Podman remote client on a Mac and connecting to Podman running on a Linux VM are documented. +* `How to sign and distribute container images using Podman <https://github.com/containers/libpod/blob/master/docs/tutorials/image_signing.md>`_: Learn how to setup and use image signing with Podman. +* `Podman remote-client tutorial <https://github.com/containers/libpod/blob/master/docs/tutorials/remote_client.md>`_: A brief how-to on using the Podman remote-client. +* `How to use libpod for custom/derivative projects <https://github.com/containers/libpod/blob/master/docs/tutorials/podman-derivative-api.md>`_: How the libpod API can be used within your own project. diff --git a/docs/source/_static/api.html b/docs/source/_static/api.html index 08f55b620..8b9d66e0d 100644 --- a/docs/source/_static/api.html +++ b/docs/source/_static/api.html @@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> - <title>ReDoc</title> + <title>Reference</title> <!-- needed for adaptive design --> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"> diff --git a/docs/source/includes.rst b/docs/source/includes.rst new file mode 100644 index 000000000..4794f454a --- /dev/null +++ b/docs/source/includes.rst @@ -0,0 +1,19 @@ +.. highlight:: bash +.. _Podman: http://podman.io +.. _OCI: https://www.opencontainers.org/ +.. _Container Engine: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.6yt1ex5wfo3l +.. _Container Engines: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.6yt1ex5wfo3l +.. _Container Runtime: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.6yt1ex5wfo55 +.. _Container: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.j2uq93kgxe0e +.. _Containers: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.j2uq93kgxe0e +.. _Container Image: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.dqlu6589ootw +.. _Container Images: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.dqlu6589ootw +.. _Container Registry: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.4cxnedx7tmvq +.. _Container Registries: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction/#h.4cxnedx7tmvq +.. _libpod: https://github.com/containers/libpod +.. _podman search: http://docs.podman.io/en/latest/markdown/podman-search.1.html +.. _podman pull: http://docs.podman.io/en/latest/markdown/podman-pull.1.html +.. _podman run: http://docs.podman.io/en/latest/markdown/podman-run.1.html +.. _podman build: http://docs.podman.io/en/latest/markdown/podman-build.1.html +.. _podman push: http://docs.podman.io/en/latest/markdown/podman-push.1.html +.. image:: https://github.com/containers/libpod/blob/master/logo/podman-logo.png?raw=true diff --git a/docs/source/index.rst b/docs/source/index.rst index 9dd61a6a6..9cc8e7af8 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,10 +1,14 @@ -.. Podman documentation master file, created by - sphinx-quickstart on Tue Oct 22 15:20:30 2019. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. +.. include:: includes.rst -Welcome to Podman's documentation! +What is Podman? ================================== +Podman_ is a daemonless, open source, Linux native tool designed to make it easy to find, run, build, share and deploy applications using Open Containers Initiative (OCI_) Containers_ and `Container Images`_. Podman provides a command line interface (CLI) familiar to anyone who has used the Docker `Container Engine`_. Most users can simply alias Docker to Podman (`alias docker=podman`) without any problems. Similiar other common `Container Engines`_ (Docker, CRI-O, containerd), Podman relies on an OCI compliant `Container Runtime`_ (runc, crun, runv, etc) to interface with the operating system and create the running containers.This makes the running containers created by Podman nearly indistinguishable from those created by any other common container engine. + +Containers under the control of Podman can either be run by root or by a non-privileged user. Podman manages the entire container ecosystem which includes pods, containers, container images, and container volumes using the libpod_ library. Podman specializes in all of the commands and functions that help you to maintain and modify OCI container images, such as pulling and tagging. It allows you to create, run, and maintain those containers and container images in a production environment. + +The Podman service runs only on Linux platforms, however a REST API and clients are currently under development which will allow Mac and Windows platforms to call the service. There is currently a Varlink based remote client which runs on Mac or Windows platforms that allows the remote client to talk to the Podman server on a Linux platform. In addition to those clients, there is also a Mac client. NOTE: the Varlink remote client will be deprecated after the REST API is completed. + +If you are completely new to containers, we recommend that you check out the :doc:`Introduction`. For power users or those comming from Docker, check out our :doc:`Tutorials`. For advanced users and contributors, you can get very detailed information about the Podman CLI by looking our :doc:`Commands` page. Finally, for Developers looking at how to interact with the Podman API, please see our API documentation :doc:`Reference`. .. toctree:: :maxdepth: 2 @@ -14,13 +18,4 @@ Welcome to Podman's documentation! Commands Reference Tutorials - - - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` + Search diff --git a/pkg/api/handlers/libpod/manifests.go b/pkg/api/handlers/libpod/manifests.go index d87ed7eba..93ca367f7 100644 --- a/pkg/api/handlers/libpod/manifests.go +++ b/pkg/api/handlers/libpod/manifests.go @@ -151,6 +151,7 @@ func ManifestPush(w http.ResponseWriter, r *http.Request) { } sc := image.GetSystemContext(rtc.Engine.SignaturePolicyPath, "", false) opts := manifests.PushOptions{ + Store: runtime.GetStore(), ImageListSelection: copy2.CopySpecificImages, SystemContext: sc, } diff --git a/pkg/api/handlers/libpod/system.go b/pkg/api/handlers/libpod/system.go index 81ed37b4a..f575546c9 100644 --- a/pkg/api/handlers/libpod/system.go +++ b/pkg/api/handlers/libpod/system.go @@ -71,16 +71,6 @@ func SystemPrune(w http.ResponseWriter, r *http.Request) { utils.WriteResponse(w, http.StatusOK, systemPruneReport) } -// SystemReset Resets podman storage back to default state -func SystemReset(w http.ResponseWriter, r *http.Request) { - err := r.Context().Value("runtime").(*libpod.Runtime).Reset(r.Context()) - if err != nil { - utils.InternalServerError(w, err) - return - } - utils.WriteResponse(w, http.StatusOK, nil) -} - func DiskUsage(w http.ResponseWriter, r *http.Request) { // Options are only used by the CLI options := entities.SystemDfOptions{} diff --git a/pkg/api/server/register_system.go b/pkg/api/server/register_system.go index 8a942a888..118ad2d08 100644 --- a/pkg/api/server/register_system.go +++ b/pkg/api/server/register_system.go @@ -27,20 +27,6 @@ func (s *APIServer) registerSystemHandlers(r *mux.Router) error { // 500: // $ref: "#/responses/InternalError" r.Handle(VersionedPath("/libpod/system/prune"), s.APIHandler(libpod.SystemPrune)).Methods(http.MethodPost) - // swagger:operation POST /libpod/system/reset libpod resetSystem - // --- - // tags: - // - system - // summary: Reset podman storage - // description: All containers will be stopped and removed, and all images, volumes and container content will be removed. - // produces: - // - application/json - // responses: - // 200: - // description: no error - // 500: - // $ref: "#/responses/InternalError" - r.Handle(VersionedPath("/libpod/system/reset"), s.APIHandler(libpod.SystemReset)).Methods(http.MethodPost) // swagger:operation GET /libpod/system/df libpod df // --- // tags: diff --git a/pkg/bindings/manifests/manifests.go b/pkg/bindings/manifests/manifests.go index 3e0ef0325..f5ee31d93 100644 --- a/pkg/bindings/manifests/manifests.go +++ b/pkg/bindings/manifests/manifests.go @@ -112,17 +112,17 @@ func Push(ctx context.Context, name string, destination *string, all *bool) (str params := url.Values{} params.Set("image", name) if destination != nil { - dest = name + dest = *destination } params.Set("destination", dest) if all != nil { params.Set("all", strconv.FormatBool(*all)) } - response, err := conn.DoRequest(nil, http.MethodPost, "/manifests/%s/push", params, name) + _, err = conn.DoRequest(nil, http.MethodPost, "/manifests/%s/push", params, name) if err != nil { return "", err } - return idr.ID, response.Process(&idr) + return idr.ID, err } // There is NO annotate endpoint. this binding could never work diff --git a/pkg/bindings/system/system.go b/pkg/bindings/system/system.go index ed960b8e0..5348d0cfb 100644 --- a/pkg/bindings/system/system.go +++ b/pkg/bindings/system/system.go @@ -122,19 +122,6 @@ func Version(ctx context.Context) (*entities.SystemVersionReport, error) { return &report, err } -// Reset removes all unused system data. -func Reset(ctx context.Context) error { - conn, err := bindings.GetClient(ctx) - if err != nil { - return err - } - response, err := conn.DoRequest(nil, http.MethodPost, "/system/reset", nil) - if err != nil { - return err - } - return response.Process(response) -} - // DiskUsage returns information about image, container, and volume disk // consumption func DiskUsage(ctx context.Context) (*entities.SystemDfReport, error) { diff --git a/pkg/bindings/test/system_test.go b/pkg/bindings/test/system_test.go index fb2df258b..27ab2f555 100644 --- a/pkg/bindings/test/system_test.go +++ b/pkg/bindings/test/system_test.go @@ -5,7 +5,6 @@ import ( "github.com/containers/libpod/pkg/bindings" "github.com/containers/libpod/pkg/bindings/containers" - "github.com/containers/libpod/pkg/bindings/images" "github.com/containers/libpod/pkg/bindings/pods" "github.com/containers/libpod/pkg/bindings/system" "github.com/containers/libpod/pkg/bindings/volumes" @@ -150,45 +149,4 @@ var _ = Describe("Podman system", func() { // Volume should be pruned now as flag set true Expect(len(systemPruneResponse.VolumePruneReport)).To(Equal(1)) }) - - It("podman system reset", func() { - // Adding an unused volume should work - _, err := volumes.Create(bt.conn, entities.VolumeCreateOptions{}) - Expect(err).To(BeNil()) - - vols, err := volumes.List(bt.conn, nil) - Expect(err).To(BeNil()) - Expect(len(vols)).To(Equal(1)) - - // Start a pod and leave it running - _, err = pods.Start(bt.conn, newpod) - Expect(err).To(BeNil()) - - imageSummary, err := images.List(bt.conn, nil, nil) - Expect(err).To(BeNil()) - // Since in the begin context images are created - Expect(len(imageSummary)).To(Equal(3)) - - err = system.Reset(bt.conn) - Expect(err).To(BeNil()) - - // re-establish connection - s = bt.startAPIService() - time.Sleep(1 * time.Second) - - // No pods - podSummary, err := pods.List(bt.conn, nil) - Expect(err).To(BeNil()) - Expect(len(podSummary)).To(Equal(0)) - - // No images - imageSummary, err = images.List(bt.conn, bindings.PTrue, nil) - Expect(err).To(BeNil()) - Expect(len(imageSummary)).To(Equal(0)) - - // no volumes - vols, err = volumes.List(bt.conn, nil) - Expect(err).To(BeNil()) - Expect(len(vols)).To(BeZero()) - }) }) diff --git a/pkg/domain/infra/tunnel/system.go b/pkg/domain/infra/tunnel/system.go index 829af31f6..109e6c1d7 100644 --- a/pkg/domain/infra/tunnel/system.go +++ b/pkg/domain/infra/tunnel/system.go @@ -27,11 +27,6 @@ func (ic *ContainerEngine) SystemPrune(ctx context.Context, options entities.Sys return system.Prune(ic.ClientCxt, &options.All, &options.Volume) } -// Reset removes all storage -func (ic *SystemEngine) Reset(ctx context.Context) error { - return system.Reset(ic.ClientCxt) -} - func (ic *ContainerEngine) SystemDf(ctx context.Context, options entities.SystemDfOptions) (*entities.SystemDfReport, error) { return system.DiskUsage(ic.ClientCxt) } diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go index c47e20276..1137ebe8e 100644 --- a/test/e2e/manifest_test.go +++ b/test/e2e/manifest_test.go @@ -155,7 +155,6 @@ var _ = Describe("Podman manifest", func() { }) It("podman manifest push", func() { - Skip(v2remotefail) session := podmanTest.Podman([]string{"manifest", "create", "foo"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -185,7 +184,8 @@ var _ = Describe("Podman manifest", func() { }) It("podman manifest push purge", func() { - Skip(v2remotefail) + // remote does not support --purge + SkipIfRemote() session := podmanTest.Podman([]string{"manifest", "create", "foo"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/system_reset_test.go b/test/e2e/system_reset_test.go index f45ff0c5f..63e77af86 100644 --- a/test/e2e/system_reset_test.go +++ b/test/e2e/system_reset_test.go @@ -34,7 +34,7 @@ var _ = Describe("podman system reset", func() { }) It("podman system reset", func() { - Skip(v2remotefail) + SkipIfRemote() // system reset will not remove additional store images, so need to grab length session := podmanTest.Podman([]string{"rmi", "--force", "--all"}) |