summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml3
-rw-r--r--cmd/podman/system/version.go21
-rw-r--r--cni/87-podman-bridge.conflist1
-rw-r--r--docs/source/Commands.rst2
-rw-r--r--docs/source/Introduction.rst106
-rw-r--r--docs/source/Reference.rst8
-rw-r--r--docs/source/Search.rst18
-rw-r--r--docs/source/Tutorials.rst10
-rw-r--r--docs/source/_static/api.html2
-rw-r--r--docs/source/includes.rst19
-rw-r--r--docs/source/index.rst25
-rw-r--r--docs/source/markdown/podman-info.1.md294
-rw-r--r--docs/source/markdown/podman-version.1.md13
-rw-r--r--go.mod2
-rw-r--r--go.sum5
-rw-r--r--libpod/define/version.go27
-rw-r--r--pkg/api/handlers/compat/images_build.go1
-rw-r--r--pkg/api/handlers/libpod/system.go10
-rw-r--r--pkg/api/server/register_images.go209
-rw-r--r--pkg/api/server/register_system.go14
-rw-r--r--pkg/bindings/images/images.go107
-rw-r--r--pkg/bindings/system/system.go25
-rw-r--r--pkg/bindings/test/system_test.go42
-rw-r--r--pkg/domain/infra/tunnel/containers.go29
-rw-r--r--pkg/domain/infra/tunnel/images.go11
-rw-r--r--pkg/domain/infra/tunnel/system.go5
-rw-r--r--pkg/network/netconflist.go9
-rw-r--r--pkg/varlinkapi/system.go2
-rw-r--r--test/e2e/images_test.go1
-rw-r--r--test/e2e/pause_test.go1
-rw-r--r--test/e2e/rm_test.go1
-rw-r--r--test/e2e/rmi_test.go4
-rw-r--r--test/e2e/start_test.go11
-rw-r--r--test/e2e/stop_test.go1
-rw-r--r--test/e2e/system_reset_test.go2
-rw-r--r--test/system/001-basic.bats2
-rw-r--r--test/system/200-pod.bats3
-rw-r--r--vendor/github.com/containers/common/pkg/config/default.go9
-rw-r--r--vendor/github.com/containers/common/pkg/config/libpodConfig.go83
-rw-r--r--vendor/modules.txt2
-rw-r--r--version/version.go4
41 files changed, 828 insertions, 316 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index c21bc74db..04b31b1e0 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -186,7 +186,6 @@ container_image_build_task:
# source code using contrib/rpm/podman.spec.in
rpmbuild_task:
- skip: $CI == 'true'
only_if: >-
$CIRRUS_CHANGE_MESSAGE !=~ '.*CI:IMG.*' &&
$CIRRUS_CHANGE_MESSAGE !=~ '.*CI:DOCS.*' &&
@@ -247,7 +246,6 @@ vendor_task:
# whether the git tree is clean.
varlink_api_task:
- skip: $CI == 'true'
only_if: >-
$CIRRUS_CHANGE_MESSAGE !=~ '.*CI:IMG.*' &&
$CIRRUS_CHANGE_MESSAGE !=~ '.*CI:DOCS.*'
@@ -711,7 +709,6 @@ special_testing_bindings_task:
special_testing_endpoint_task:
- skip: $CI == 'true'
depends_on:
- "gating"
- "varlink_api"
diff --git a/cmd/podman/system/version.go b/cmd/podman/system/version.go
index 50bd81368..92a3225b6 100644
--- a/cmd/podman/system/version.go
+++ b/cmd/podman/system/version.go
@@ -6,8 +6,8 @@ import (
"os"
"strings"
"text/tabwriter"
- "time"
+ "github.com/containers/buildah/pkg/formats"
"github.com/containers/libpod/cmd/podman/registry"
"github.com/containers/libpod/cmd/podman/validate"
"github.com/containers/libpod/libpod/define"
@@ -52,6 +52,17 @@ func version(cmd *cobra.Command, args []string) error {
if !strings.HasSuffix(versionFormat, "\n") {
versionFormat += "\n"
}
+ out := formats.StdoutTemplate{Output: versions, Template: versionFormat}
+ err := out.Out()
+ if err != nil {
+ // On Failure, assume user is using older version of podman version --format and check client
+ versionFormat = strings.Replace(versionFormat, ".Server.", ".", 1)
+ out = formats.StdoutTemplate{Output: versions.Client, Template: versionFormat}
+ if err1 := out.Out(); err1 != nil {
+ return err
+ }
+ }
+ return nil
}
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
@@ -74,15 +85,11 @@ func version(cmd *cobra.Command, args []string) error {
func formatVersion(writer io.Writer, version *define.Version) {
fmt.Fprintf(writer, "Version:\t%s\n", version.Version)
- fmt.Fprintf(writer, "RemoteAPI Version:\t%d\n", version.RemoteAPIVersion)
+ fmt.Fprintf(writer, "API Version:\t%d\n", version.APIVersion)
fmt.Fprintf(writer, "Go Version:\t%s\n", version.GoVersion)
if version.GitCommit != "" {
fmt.Fprintf(writer, "Git Commit:\t%s\n", version.GitCommit)
}
- // Prints out the build time in readable format
- if version.Built != 0 {
- fmt.Fprintf(writer, "Built:\t%s\n", time.Unix(version.Built, 0).Format(time.ANSIC))
- }
-
+ fmt.Fprintf(writer, "Built:\t%s\n", version.BuiltTime)
fmt.Fprintf(writer, "OS/Arch:\t%s\n", version.OsArch)
}
diff --git a/cni/87-podman-bridge.conflist b/cni/87-podman-bridge.conflist
index 13b09a5b5..ef760a61b 100644
--- a/cni/87-podman-bridge.conflist
+++ b/cni/87-podman-bridge.conflist
@@ -7,6 +7,7 @@
"bridge": "cni-podman0",
"isGateway": true,
"ipMasq": true,
+ "hairpinMode": true,
"ipam": {
"type": "host-local",
"routes": [{ "dst": "0.0.0.0/0" }],
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/docs/source/markdown/podman-info.1.md b/docs/source/markdown/podman-info.1.md
index d9da4c3f8..24ab97c91 100644
--- a/docs/source/markdown/podman-info.1.md
+++ b/docs/source/markdown/podman-info.1.md
@@ -30,128 +30,212 @@ Run podman info with plain text response:
```
$ podman info
host:
- BuildahVersion: 1.4-dev
- Conmon:
- package: Unknown
- path: /usr/libexec/podman/conmon
- version: 'conmon version 1.12.0-dev, commit: d724f3d54ad2d95b6de741085d4990190ebfd7ff'
- Distribution:
- distribution: fedora
- version: "28"
- MemFree: 1271083008
- MemTotal: 33074233344
- OCIRuntime:
- package: runc-1.0.0-51.dev.gitfdd8055.fc28.x86_64
- path: /usr/bin/runc
- version: 'runc version spec: 1.0.0'
- SwapFree: 34309664768
- SwapTotal: 34359734272
arch: amd64
+ buildahVersion: 1.15.0
+ cgroupVersion: v1
+ conmon:
+ package: conmon-2.0.16-2.fc32.x86_64
+ path: /usr/bin/conmon
+ version: 'conmon version 2.0.16, commit: 1044176f7dd177c100779d1c63931d6022e419bd'
cpus: 8
+ distribution:
+ distribution: fedora
+ version: "32"
+ eventLogger: file
hostname: localhost.localdomain
- kernel: 4.18.7-200.fc28.x86_64
+ idMappings:
+ gidmap:
+ - container_id: 0
+ host_id: 3267
+ size: 1
+ - container_id: 1
+ host_id: 100000
+ size: 65536
+ uidmap:
+ - container_id: 0
+ host_id: 3267
+ size: 1
+ - container_id: 1
+ host_id: 100000
+ size: 65536
+ kernel: 5.6.11-300.fc32.x86_64
+ linkmode: dynamic
+ memFree: 1401929728
+ memTotal: 16416161792
+ ociRuntime:
+ name: runc
+ package: containerd.io-1.2.10-3.2.fc31.x86_64
+ path: /usr/bin/runc
+ version: |-
+ runc version 1.0.0-rc8+dev
+ commit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
+ spec: 1.0.1-dev
os: linux
- uptime: 218h 49m 33.66s (Approximately 9.08 days)
+ rootless: true
+ slirp4netns:
+ executable: /bin/slirp4netns
+ package: slirp4netns-1.0.0-1.fc32.x86_64
+ version: |-
+ slirp4netns version 1.0.0
+ commit: a3be729152a33e692cd28b52f664defbf2e7810a
+ libslirp: 4.2.0
+ swapFree: 8291610624
+ swapTotal: 8296329216
+ uptime: 52h 29m 39.78s (Approximately 2.17 days)
registries:
- docker.io:
- Blocked: true
- Insecure: true
- Location: docker.io
- MirrorByDigestOnly: false
- Mirrors:
- - Insecure: true
- Location: example2.io/example/ubi8-minimal
- Prefix: docker.io
- redhat.com:
- Blocked: false
- Insecure: false
- Location: registry.access.redhat.com/ubi8
- MirrorByDigestOnly: true
- Mirrors:
- - Insecure: false
- Location: example.io/example/ubi8-minimal
- - Insecure: true
- Location: example3.io/example/ubi8-minimal
- Prefix: redhat.com
+ search:
+ - registry.fedoraproject.org
+ - registry.access.redhat.com
+ - registry.centos.org
+ - docker.io
store:
- ConfigFile: /etc/containers/storage.conf
- ContainerStore:
- number: 37
- GraphDriverName: overlay
- GraphOptions:
- - overlay.mountopt=nodev
- - overlay.override_kernel_check=true
- GraphRoot: /var/lib/containers/storage
- GraphStatus:
+ configFile: /home/dwalsh/.config/containers/storage.conf
+ containerStore:
+ number: 2
+ paused: 0
+ running: 0
+ stopped: 2
+ graphDriverName: overlay
+ graphOptions:
+ overlay.mount_program:
+ Executable: /home/dwalsh/bin/fuse-overlayfs
+ Package: Unknown
+ Version: |-
+ fusermount3 version: 3.9.1
+ fuse-overlayfs: version 0.7.2
+ FUSE library version 3.9.1
+ using FUSE kernel interface version 7.31
+ graphRoot: /home/dwalsh/.local/share/containers/storage
+ graphStatus:
Backing Filesystem: extfs
- Native Overlay Diff: "true"
+ Native Overlay Diff: "false"
Supports d_type: "true"
- ImageStore:
- number: 17
- RunRoot: /var/run/containers/storage
-
+ Using metacopy: "false"
+ imageStore:
+ number: 7
+ runRoot: /run/user/3267/containers
+ volumePath: /home/dwalsh/.local/share/containers/storage/volumes
+version:
+ Built: 1589899246
+ BuiltTime: Tue May 19 10:40:46 2020
+ GitCommit: c3678ce3289f4195f3f16802411e795c6a587c9f-dirty
+ GoVersion: go1.14.2
+ OsArch: linux/amd64
+ APIVersion: 1
+ Version: 2.0.0
```
Run podman info with JSON formatted response:
```
{
- "host": {
- "BuildahVersion": "1.4-dev",
- "Conmon": {
- "package": "Unknown",
- "path": "/usr/libexec/podman/conmon",
- "version": "conmon version 1.12.0-dev, commit: d724f3d54ad2d95b6de741085d4990190ebfd7ff"
- },
- "Distribution": {
- "distribution": "fedora",
- "version": "28"
+ "host": {
+ "arch": "amd64",
+ "buildahVersion": "1.15.0",
+ "cgroupVersion": "v1",
+ "conmon": {
+ "package": "conmon-2.0.16-2.fc32.x86_64",
+ "path": "/usr/bin/conmon",
+ "version": "conmon version 2.0.16, commit: 1044176f7dd177c100779d1c63931d6022e419bd"
+ },
+ "cpus": 8,
+ "distribution": {
+ "distribution": "fedora",
+ "version": "32"
+ },
+ "eventLogger": "file",
+ "hostname": "localhost.localdomain",
+ "idMappings": {
+ "gidmap": [
+ {
+ "container_id": 0,
+ "host_id": 3267,
+ "size": 1
},
- "MemFree": 1204109312,
- "MemTotal": 33074233344,
- "OCIRuntime": {
- "package": "runc-1.0.0-51.dev.gitfdd8055.fc28.x86_64",
- "path": "/usr/bin/runc",
- "version": "runc version spec: 1.0.0"
+ {
+ "container_id": 1,
+ "host_id": 100000,
+ "size": 65536
+ }
+ ],
+ "uidmap": [
+ {
+ "container_id": 0,
+ "host_id": 3267,
+ "size": 1
},
- "SwapFree": 34309664768,
- "SwapTotal": 34359734272,
- "arch": "amd64",
- "cpus": 8,
- "hostname": "localhost.localdomain",
- "kernel": "4.18.7-200.fc28.x86_64",
- "os": "linux",
- "uptime": "218h 50m 35.02s (Approximately 9.08 days)"
+ {
+ "container_id": 1,
+ "host_id": 100000,
+ "size": 65536
+ }
+ ]
},
- "insecure registries": {
- "registries": []
+ "kernel": "5.6.11-300.fc32.x86_64",
+ "memFree": 1380356096,
+ "memTotal": 16416161792,
+ "ociRuntime": {
+ "name": "runc",
+ "package": "containerd.io-1.2.10-3.2.fc31.x86_64",
+ "path": "/usr/bin/runc",
+ "version": "runc version 1.0.0-rc8+dev\ncommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657\nspec: 1.0.1-dev"
},
- "registries": {
- "registries": [
- "quay.io",
- "registry.fedoraproject.org",
- "docker.io",
- "registry.access.redhat.com"
- ]
+ "os": "linux",
+ "rootless": true,
+ "slirp4netns": {
+ "executable": "/bin/slirp4netns",
+ "package": "slirp4netns-1.0.0-1.fc32.x86_64",
+ "version": "slirp4netns version 1.0.0\ncommit: a3be729152a33e692cd28b52f664defbf2e7810a\nlibslirp: 4.2.0"
},
- "store": {
- "ContainerStore": {
- "number": 37
- },
- "GraphDriverName": "overlay",
- "GraphOptions": [
- "overlay.mountopt=nodev",
- "overlay.override_kernel_check=true"
- ],
- "GraphRoot": "/var/lib/containers/storage",
- "GraphStatus": {
- "Backing Filesystem": "extfs",
- "Native Overlay Diff": "true",
- "Supports d_type": "true"
- },
- "ImageStore": {
- "number": 17
- },
- "RunRoot": "/var/run/containers/storage"
- }
+ "swapFree": 8291610624,
+ "swapTotal": 8296329216,
+ "uptime": "52h 27m 39.38s (Approximately 2.17 days)",
+ "linkmode": "dynamic"
+ },
+ "store": {
+ "configFile": "/home/dwalsh/.config/containers/storage.conf",
+ "containerStore": {
+ "number": 2,
+ "paused": 0,
+ "running": 0,
+ "stopped": 2
+ },
+ "graphDriverName": "overlay",
+ "graphOptions": {
+ "overlay.mount_program": {
+ "Executable": "/home/dwalsh/bin/fuse-overlayfs",
+ "Package": "Unknown",
+ "Version": "fusermount3 version: 3.9.1\nfuse-overlayfs: version 0.7.2\nFUSE library version 3.9.1\nusing FUSE kernel interface version 7.31"
+}
+ },
+ "graphRoot": "/home/dwalsh/.local/share/containers/storage",
+ "graphStatus": {
+ "Backing Filesystem": "extfs",
+ "Native Overlay Diff": "false",
+ "Supports d_type": "true",
+ "Using metacopy": "false"
+ },
+ "imageStore": {
+ "number": 7
+ },
+ "runRoot": "/run/user/3267/containers",
+ "volumePath": "/home/dwalsh/.local/share/containers/storage/volumes"
+ },
+ "registries": {
+ "search": [
+ "registry.fedoraproject.org",
+ "registry.access.redhat.com",
+ "registry.centos.org",
+ "docker.io"
+]
+ },
+ "version": {
+ "APIVersion": 1,
+ "Version": "2.0.0",
+ "GoVersion": "go1.14.2",
+ "GitCommit": "c3678ce3289f4195f3f16802411e795c6a587c9f-dirty",
+ "BuiltTime": "Tue May 19 10:40:46 2020",
+ "Built": 1589899246,
+ "OsArch": "linux/amd64"
+ }
}
```
Run podman info and only get the registries information.
diff --git a/docs/source/markdown/podman-version.1.md b/docs/source/markdown/podman-version.1.md
index 86c270e02..185e8e296 100644
--- a/docs/source/markdown/podman-version.1.md
+++ b/docs/source/markdown/podman-version.1.md
@@ -25,17 +25,18 @@ Change output format to "json" or a Go template.
A sample output of the `version` command:
```
$ podman version
-Version: 0.11.1
-Go Version: go1.11
-Git Commit: "8967a1d691ed44896b81ad48c863033f23c65eb0-dirty"
-Built: Thu Nov 8 22:35:40 2018
-OS/Arch: linux/amd64
+Version: 2.0.0
+API Version: 1
+Go Version: go1.14.2
+Git Commit: 4520664f63c3a7f9a80227715359e20069d95542
+Built: Tue May 19 10:48:59 2020
+OS/Arch: linux/amd64
```
Filtering out only the version:
```
$ podman version --format '{{.Client.Version}}'
-1.6.3
+2.0.0
```
## SEE ALSO
diff --git a/go.mod b/go.mod
index aadce78c3..1fb60d41d 100644
--- a/go.mod
+++ b/go.mod
@@ -11,7 +11,7 @@ require (
github.com/containernetworking/cni v0.7.2-0.20200304161608-4fae32b84921
github.com/containernetworking/plugins v0.8.6
github.com/containers/buildah v1.14.9-0.20200501175434-42a48f9373d9
- github.com/containers/common v0.11.2
+ github.com/containers/common v0.11.4
github.com/containers/conmon v2.0.16+incompatible
github.com/containers/image/v5 v5.4.4
github.com/containers/psgo v1.5.0
diff --git a/go.sum b/go.sum
index fc2907d70..ae9ecebce 100644
--- a/go.sum
+++ b/go.sum
@@ -72,8 +72,8 @@ github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHV
github.com/containers/buildah v1.14.9-0.20200501175434-42a48f9373d9 h1:EGegltin15wEzCI/5jeHcxBKfwwIHYkBUvsYC3XP060=
github.com/containers/buildah v1.14.9-0.20200501175434-42a48f9373d9/go.mod h1:+2aNsVcd4pVzmVAbOfWN5X+0Lpz2rtICSGXbTSCzdBU=
github.com/containers/common v0.10.0/go.mod h1:6A/moCuQITXLqBe5A0WKKTcCfCmEQRbknI05HcPzOL0=
-github.com/containers/common v0.11.2 h1:e4477fCE3qSA+Z2vT+uUMUTn8s8CyIM++qNm3PCSl68=
-github.com/containers/common v0.11.2/go.mod h1:2w3QE6VUmhltGYW4wV00h4okq1Crs7hNI1ZD2I0QRUY=
+github.com/containers/common v0.11.4 h1:M7lmjaVY+29g+YiaWH/UP4YeHjT/pZMxvRgmsWsQn74=
+github.com/containers/common v0.11.4/go.mod h1:AOxw4U5TJJrR/J1QPRvWbjHNdwU13wMy79rjK+7+aJE=
github.com/containers/conmon v2.0.16+incompatible h1:QFOlb9Id4WoJ24BelCFWwDSPTquwKMp3L3g2iGmRTq4=
github.com/containers/conmon v2.0.16+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
github.com/containers/image/v5 v5.4.3/go.mod h1:pN0tvp3YbDd7BWavK2aE0mvJUqVd2HmhPjekyWSFm0U=
@@ -337,7 +337,6 @@ github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
-github.com/onsi/gomega v1.10.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
diff --git a/libpod/define/version.go b/libpod/define/version.go
index 954cd00f1..3eb016264 100644
--- a/libpod/define/version.go
+++ b/libpod/define/version.go
@@ -3,6 +3,7 @@ package define
import (
"runtime"
"strconv"
+ "time"
podmanVersion "github.com/containers/libpod/version"
)
@@ -19,12 +20,13 @@ var (
// Version is an output struct for varlink
type Version struct {
- RemoteAPIVersion int64
- Version string
- GoVersion string
- GitCommit string
- Built int64
- OsArch string
+ APIVersion int64
+ Version string
+ GoVersion string
+ GitCommit string
+ BuiltTime string
+ Built int64
+ OsArch string
}
// GetVersion returns a VersionOutput struct for varlink and podman
@@ -40,11 +42,12 @@ func GetVersion() (Version, error) {
}
}
return Version{
- RemoteAPIVersion: podmanVersion.RemoteAPIVersion,
- Version: podmanVersion.Version,
- GoVersion: runtime.Version(),
- GitCommit: gitCommit,
- Built: buildTime,
- OsArch: runtime.GOOS + "/" + runtime.GOARCH,
+ APIVersion: podmanVersion.APIVersion,
+ Version: podmanVersion.Version,
+ GoVersion: runtime.Version(),
+ GitCommit: gitCommit,
+ BuiltTime: time.Unix(buildTime, 0).Format(time.ANSIC),
+ Built: buildTime,
+ OsArch: runtime.GOOS + "/" + runtime.GOARCH,
}, nil
}
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go
index e208e6ddc..e9d8fd719 100644
--- a/pkg/api/handlers/compat/images_build.go
+++ b/pkg/api/handlers/compat/images_build.go
@@ -226,6 +226,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
id, _, err := runtime.Build(r.Context(), buildOptions, query.Dockerfile)
if err != nil {
utils.InternalServerError(w, err)
+ return
}
// Find image ID that was built...
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_images.go b/pkg/api/server/register_images.go
index 01854b9c4..c885dc81a 100644
--- a/pkg/api/server/register_images.go
+++ b/pkg/api/server/register_images.go
@@ -1188,5 +1188,214 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/images/{name}/changes"), s.APIHandler(compat.Changes)).Methods(http.MethodGet)
+ // swagger:operation POST /libpod/build libpod libpodBuildImage
+ // ---
+ // tags:
+ // - images
+ // summary: Create image
+ // description: Build an image from the given Dockerfile(s)
+ // parameters:
+ // - in: query
+ // name: dockerfile
+ // type: string
+ // default: Dockerfile
+ // description: |
+ // Path within the build context to the `Dockerfile`.
+ // This is ignored if remote is specified and points to an external `Dockerfile`.
+ // - in: query
+ // name: t
+ // type: string
+ // default: latest
+ // description: A name and optional tag to apply to the image in the `name:tag` format.
+ // - in: query
+ // name: extrahosts
+ // type: string
+ // default:
+ // description: |
+ // TBD Extra hosts to add to /etc/hosts
+ // (As of version 1.xx)
+ // - in: query
+ // name: remote
+ // type: string
+ // default:
+ // description: |
+ // A Git repository URI or HTTP/HTTPS context URI.
+ // If the URI points to a single text file, the file’s contents are placed
+ // into a file called Dockerfile and the image is built from that file. If
+ // the URI points to a tarball, the file is downloaded by the daemon and the
+ // contents therein used as the context for the build. If the URI points to a
+ // tarball and the dockerfile parameter is also specified, there must be a file
+ // with the corresponding path inside the tarball.
+ // (As of version 1.xx)
+ // - in: query
+ // name: q
+ // type: boolean
+ // default: false
+ // description: |
+ // Suppress verbose build output
+ // - in: query
+ // name: nocache
+ // type: boolean
+ // default: false
+ // description: |
+ // Do not use the cache when building the image
+ // (As of version 1.xx)
+ // - in: query
+ // name: cachefrom
+ // type: string
+ // default:
+ // description: |
+ // JSON array of images used to build cache resolution
+ // (As of version 1.xx)
+ // - in: query
+ // name: pull
+ // type: boolean
+ // default: false
+ // description: |
+ // Attempt to pull the image even if an older image exists locally
+ // (As of version 1.xx)
+ // - in: query
+ // name: rm
+ // type: boolean
+ // default: true
+ // description: |
+ // Remove intermediate containers after a successful build
+ // (As of version 1.xx)
+ // - in: query
+ // name: forcerm
+ // type: boolean
+ // default: false
+ // description: |
+ // Always remove intermediate containers, even upon failure
+ // (As of version 1.xx)
+ // - in: query
+ // name: memory
+ // type: integer
+ // description: |
+ // Memory is the upper limit (in bytes) on how much memory running containers can use
+ // (As of version 1.xx)
+ // - in: query
+ // name: memswap
+ // type: integer
+ // description: |
+ // MemorySwap limits the amount of memory and swap together
+ // (As of version 1.xx)
+ // - in: query
+ // name: cpushares
+ // type: integer
+ // description: |
+ // CPUShares (relative weight
+ // (As of version 1.xx)
+ // - in: query
+ // name: cpusetcpus
+ // type: string
+ // description: |
+ // CPUSetCPUs in which to allow execution (0-3, 0,1)
+ // (As of version 1.xx)
+ // - in: query
+ // name: cpuperiod
+ // type: integer
+ // description: |
+ // CPUPeriod limits the CPU CFS (Completely Fair Scheduler) period
+ // (As of version 1.xx)
+ // - in: query
+ // name: cpuquota
+ // type: integer
+ // description: |
+ // CPUQuota limits the CPU CFS (Completely Fair Scheduler) quota
+ // (As of version 1.xx)
+ // - in: query
+ // name: buildargs
+ // type: string
+ // default:
+ // description: |
+ // JSON map of string pairs denoting build-time variables.
+ // For example, the build argument `Foo` with the value of `bar` would be encoded in JSON as `["Foo":"bar"]`.
+ //
+ // For example, buildargs={"Foo":"bar"}.
+ //
+ // Note(s):
+ // * This should not be used to pass secrets.
+ // * The value of buildargs should be URI component encoded before being passed to the API.
+ //
+ // (As of version 1.xx)
+ // - in: query
+ // name: shmsize
+ // type: integer
+ // default: 67108864
+ // description: |
+ // ShmSize is the "size" value to use when mounting an shmfs on the container's /dev/shm directory.
+ // Default is 64MB
+ // (As of version 1.xx)
+ // - in: query
+ // name: squash
+ // type: boolean
+ // default: false
+ // description: |
+ // Silently ignored.
+ // Squash the resulting images layers into a single layer
+ // (As of version 1.xx)
+ // - in: query
+ // name: labels
+ // type: string
+ // default:
+ // description: |
+ // JSON map of key, value pairs to set as labels on the new image
+ // (As of version 1.xx)
+ // - in: query
+ // name: networkmode
+ // type: string
+ // default: bridge
+ // description: |
+ // Sets the networking mode for the run commands during build.
+ // Supported standard values are:
+ // * `bridge` limited to containers within a single host, port mapping required for external access
+ // * `host` no isolation between host and containers on this network
+ // * `none` disable all networking for this container
+ // * container:<nameOrID> share networking with given container
+ // ---All other values are assumed to be a custom network's name
+ // (As of version 1.xx)
+ // - in: query
+ // name: platform
+ // type: string
+ // default:
+ // description: |
+ // Platform format os[/arch[/variant]]
+ // (As of version 1.xx)
+ // - in: query
+ // name: target
+ // type: string
+ // default:
+ // description: |
+ // Target build stage
+ // (As of version 1.xx)
+ // - in: query
+ // name: outputs
+ // type: string
+ // default:
+ // description: |
+ // output configuration TBD
+ // (As of version 1.xx)
+ // produces:
+ // - application/json
+ // responses:
+ // 200:
+ // description: OK (As of version 1.xx)
+ // schema:
+ // type: object
+ // required:
+ // - stream
+ // properties:
+ // stream:
+ // type: string
+ // description: output from build process
+ // example: |
+ // (build details...)
+ // Successfully built 8ba084515c724cbf90d447a63600c0a6
+ // 400:
+ // $ref: "#/responses/BadParamError"
+ // 500:
+ // $ref: "#/responses/InternalError"
+ r.Handle(VersionedPath("/libpod/build"), s.APIHandler(compat.BuildImage)).Methods(http.MethodPost)
return nil
}
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/images/images.go b/pkg/bindings/images/images.go
index 69b9e9bbf..f9c02d199 100644
--- a/pkg/bindings/images/images.go
+++ b/pkg/bindings/images/images.go
@@ -1,6 +1,7 @@
package images
import (
+ "bytes"
"context"
"fmt"
"io"
@@ -8,10 +9,13 @@ import (
"net/url"
"strconv"
+ "github.com/containers/buildah"
"github.com/containers/image/v5/types"
"github.com/containers/libpod/pkg/api/handlers"
"github.com/containers/libpod/pkg/bindings"
"github.com/containers/libpod/pkg/domain/entities"
+ "github.com/docker/go-units"
+ jsoniter "github.com/json-iterator/go"
"github.com/pkg/errors"
)
@@ -209,7 +213,108 @@ func Untag(ctx context.Context, nameOrID, tag, repo string) error {
return response.Process(nil)
}
-func Build(nameOrId string) {}
+// Build creates an image using a containerfile reference
+func Build(ctx context.Context, containerFiles []string, options entities.BuildOptions, tarfile io.Reader) (*entities.BuildReport, error) {
+ var (
+ platform string
+ report entities.BuildReport
+ )
+ conn, err := bindings.GetClient(ctx)
+ if err != nil {
+ return nil, err
+ }
+ params := url.Values{}
+ params.Set("dockerfile", containerFiles[0])
+ if t := options.Output; len(t) > 0 {
+ params.Set("t", t)
+ }
+ // TODO Remote, Quiet
+ if options.NoCache {
+ params.Set("nocache", "1")
+ }
+ // TODO cachefrom
+ if options.PullPolicy == buildah.PullAlways {
+ params.Set("pull", "1")
+ }
+ if options.RemoveIntermediateCtrs {
+ params.Set("rm", "1")
+ }
+ if options.ForceRmIntermediateCtrs {
+ params.Set("forcerm", "1")
+ }
+ if mem := options.CommonBuildOpts.Memory; mem > 0 {
+ params.Set("memory", strconv.Itoa(int(mem)))
+ }
+ if memSwap := options.CommonBuildOpts.MemorySwap; memSwap > 0 {
+ params.Set("memswap", strconv.Itoa(int(memSwap)))
+ }
+ if cpuShares := options.CommonBuildOpts.CPUShares; cpuShares > 0 {
+ params.Set("cpushares", strconv.Itoa(int(cpuShares)))
+ }
+ if cpuSetCpus := options.CommonBuildOpts.CPUSetCPUs; len(cpuSetCpus) > 0 {
+ params.Set("cpusetcpues", cpuSetCpus)
+ }
+ if cpuPeriod := options.CommonBuildOpts.CPUPeriod; cpuPeriod > 0 {
+ params.Set("cpuperiod", strconv.Itoa(int(cpuPeriod)))
+ }
+ if cpuQuota := options.CommonBuildOpts.CPUQuota; cpuQuota > 0 {
+ params.Set("cpuquota", strconv.Itoa(int(cpuQuota)))
+ }
+ if buildArgs := options.Args; len(buildArgs) > 0 {
+ bArgs, err := jsoniter.MarshalToString(buildArgs)
+ if err != nil {
+ return nil, err
+ }
+ params.Set("buildargs", bArgs)
+ }
+ if shmSize := options.CommonBuildOpts.ShmSize; len(shmSize) > 0 {
+ shmBytes, err := units.RAMInBytes(shmSize)
+ if err != nil {
+ return nil, err
+ }
+ params.Set("shmsize", strconv.Itoa(int(shmBytes)))
+ }
+ if options.Squash {
+ params.Set("squash", "1")
+ }
+ if labels := options.Labels; len(labels) > 0 {
+ l, err := jsoniter.MarshalToString(labels)
+ if err != nil {
+ return nil, err
+ }
+ params.Set("labels", l)
+ }
+
+ // TODO network?
+ if OS := options.OS; len(OS) > 0 {
+ platform += OS
+ }
+ if arch := options.Architecture; len(arch) > 0 {
+ platform += "/" + arch
+ }
+ if len(platform) > 0 {
+ params.Set("platform", platform)
+ }
+ // TODO outputs?
+
+ response, err := conn.DoRequest(tarfile, http.MethodPost, "/build", params)
+ if err != nil {
+ return nil, err
+ }
+ var streamReponse []byte
+ bb := bytes.NewBuffer(streamReponse)
+ if _, err = io.Copy(bb, response.Body); err != nil {
+ return nil, err
+ }
+ var s struct {
+ Stream string `json:"stream"`
+ }
+ if err := jsoniter.UnmarshalFromString(bb.String(), &s); err != nil {
+ return nil, err
+ }
+ fmt.Print(s.Stream)
+ return &report, nil
+}
// Imports adds the given image to the local image store. This can be done by file and the given reader
// or via the url parameter. Additional metadata can be associated with the image by using the changes and
diff --git a/pkg/bindings/system/system.go b/pkg/bindings/system/system.go
index e567e7a86..5348d0cfb 100644
--- a/pkg/bindings/system/system.go
+++ b/pkg/bindings/system/system.go
@@ -112,29 +112,16 @@ func Version(ctx context.Context) (*entities.SystemVersionReport, error) {
f, _ := strconv.ParseFloat(component.APIVersion, 64)
b, _ := time.Parse(time.RFC3339, component.BuildTime)
report.Server = &define.Version{
- RemoteAPIVersion: int64(f),
- Version: component.Version.Version,
- GoVersion: component.GoVersion,
- GitCommit: component.GitCommit,
- Built: b.Unix(),
- OsArch: fmt.Sprintf("%s/%s", component.Os, component.Arch),
+ APIVersion: int64(f),
+ Version: component.Version.Version,
+ GoVersion: component.GoVersion,
+ GitCommit: component.GitCommit,
+ Built: b.Unix(),
+ OsArch: fmt.Sprintf("%s/%s", component.Os, component.Arch),
}
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/containers.go b/pkg/domain/infra/tunnel/containers.go
index d02c54e76..30c4a8359 100644
--- a/pkg/domain/infra/tunnel/containers.go
+++ b/pkg/domain/infra/tunnel/containers.go
@@ -87,10 +87,25 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin
}
for _, c := range ctrs {
report := entities.StopReport{Id: c.ID}
- report.Err = containers.Stop(ic.ClientCxt, c.ID, &options.Timeout)
- // TODO we need to associate errors returned by http with common
- // define.errors so that we can equity tests. this will allow output
- // to be the same as the native client
+ if err = containers.Stop(ic.ClientCxt, c.ID, &options.Timeout); err != nil {
+ // These first two are considered non-fatal under the right conditions
+ if errors.Cause(err).Error() == define.ErrCtrStopped.Error() {
+ logrus.Debugf("Container %s is already stopped", c.ID)
+ reports = append(reports, &report)
+ continue
+ } else if options.All && errors.Cause(err).Error() == define.ErrCtrStateInvalid.Error() {
+ logrus.Debugf("Container %s is not running, could not stop", c.ID)
+ reports = append(reports, &report)
+ continue
+ }
+
+ // TODO we need to associate errors returned by http with common
+ // define.errors so that we can equity tests. this will allow output
+ // to be the same as the native client
+ report.Err = err
+ reports = append(reports, &report)
+ continue
+ }
reports = append(reports, &report)
}
return reports, nil
@@ -357,7 +372,11 @@ func startAndAttach(ic *ContainerEngine, name string, detachKeys *string, input,
func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []string, options entities.ContainerStartOptions) ([]*entities.ContainerStartReport, error) {
var reports []*entities.ContainerStartReport
for _, name := range namesOrIds {
- report := entities.ContainerStartReport{Id: name}
+ report := entities.ContainerStartReport{
+ Id: name,
+ RawInput: name,
+ ExitCode: 125,
+ }
if options.Attach {
report.Err = startAndAttach(ic, name, &options.DetachKeys, options.Stdin, options.Stdout, options.Stderr)
if report.Err == nil {
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go
index 3d5626c45..c300e74d0 100644
--- a/pkg/domain/infra/tunnel/images.go
+++ b/pkg/domain/infra/tunnel/images.go
@@ -4,6 +4,7 @@ import (
"context"
"io/ioutil"
"os"
+ "path"
"strings"
"github.com/containers/common/pkg/config"
@@ -13,6 +14,7 @@ import (
"github.com/containers/libpod/pkg/domain/entities"
"github.com/containers/libpod/pkg/domain/utils"
utils2 "github.com/containers/libpod/utils"
+ "github.com/containers/storage/pkg/archive"
"github.com/pkg/errors"
)
@@ -265,7 +267,14 @@ func (ir *ImageEngine) Config(_ context.Context) (*config.Config, error) {
}
func (ir *ImageEngine) Build(ctx context.Context, containerFiles []string, opts entities.BuildOptions) (*entities.BuildReport, error) {
- return nil, errors.New("not implemented yet")
+ if len(containerFiles) > 1 {
+ return nil, errors.New("something")
+ }
+ tarfile, err := archive.Tar(path.Base(containerFiles[0]), 0)
+ if err != nil {
+ return nil, err
+ }
+ return images.Build(ir.ClientCxt, containerFiles, opts, tarfile)
}
func (ir *ImageEngine) Tree(ctx context.Context, nameOrId string, opts entities.ImageTreeOptions) (*entities.ImageTreeReport, error) {
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/pkg/network/netconflist.go b/pkg/network/netconflist.go
index 34ff00024..4271d3f54 100644
--- a/pkg/network/netconflist.go
+++ b/pkg/network/netconflist.go
@@ -21,10 +21,11 @@ func NewNcList(name, version string) NcList {
// NewHostLocalBridge creates a new LocalBridge for host-local
func NewHostLocalBridge(name string, isGateWay, isDefaultGW, ipMasq bool, ipamConf IPAMHostLocalConf) *HostLocalBridge {
hostLocalBridge := HostLocalBridge{
- PluginType: "bridge",
- BrName: name,
- IPMasq: ipMasq,
- IPAM: ipamConf,
+ PluginType: "bridge",
+ BrName: name,
+ IPMasq: ipMasq,
+ HairpinMode: true,
+ IPAM: ipamConf,
}
if isGateWay {
hostLocalBridge.IsGW = true
diff --git a/pkg/varlinkapi/system.go b/pkg/varlinkapi/system.go
index 82efe9b5d..308f02274 100644
--- a/pkg/varlinkapi/system.go
+++ b/pkg/varlinkapi/system.go
@@ -28,7 +28,7 @@ func (i *VarlinkAPI) GetVersion(call iopodman.VarlinkCall) error {
versionInfo.GitCommit,
time.Unix(versionInfo.Built, 0).Format(time.RFC3339),
versionInfo.OsArch,
- versionInfo.RemoteAPIVersion,
+ versionInfo.APIVersion,
)
}
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go
index 1715cf8c1..1b23aba36 100644
--- a/test/e2e/images_test.go
+++ b/test/e2e/images_test.go
@@ -131,7 +131,6 @@ var _ = Describe("Podman images", func() {
})
It("podman images filter by image name", func() {
- Skip(v2remotefail)
podmanTest.RestoreAllArtifacts()
session := podmanTest.PodmanNoCache([]string{"images", "-q", ALPINE})
session.WaitWithDefaultTimeout()
diff --git a/test/e2e/pause_test.go b/test/e2e/pause_test.go
index 2faa4bc3f..149a2e28a 100644
--- a/test/e2e/pause_test.go
+++ b/test/e2e/pause_test.go
@@ -297,7 +297,6 @@ var _ = Describe("Podman pause", func() {
})
It("Unpause a bunch of running containers", func() {
- Skip(v2remotefail)
for i := 0; i < 3; i++ {
name := fmt.Sprintf("test%d", i)
run := podmanTest.Podman([]string{"run", "-dt", "--name", name, nginx})
diff --git a/test/e2e/rm_test.go b/test/e2e/rm_test.go
index 552683d8c..87e3de922 100644
--- a/test/e2e/rm_test.go
+++ b/test/e2e/rm_test.go
@@ -43,7 +43,6 @@ var _ = Describe("Podman rm", func() {
})
It("podman rm refuse to remove a running container", func() {
- Skip(v2remotefail)
session := podmanTest.RunTopContainer("")
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
diff --git a/test/e2e/rmi_test.go b/test/e2e/rmi_test.go
index 150726ce4..b17c03d63 100644
--- a/test/e2e/rmi_test.go
+++ b/test/e2e/rmi_test.go
@@ -75,7 +75,6 @@ var _ = Describe("Podman rmi", func() {
})
It("podman rmi tagged image", func() {
- Skip(v2remotefail)
setup := podmanTest.PodmanNoCache([]string{"images", "-q", ALPINE})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
@@ -92,7 +91,6 @@ var _ = Describe("Podman rmi", func() {
})
It("podman rmi image with tags by ID cannot be done without force", func() {
- Skip(v2remotefail)
setup := podmanTest.PodmanNoCache([]string{"images", "-q", ALPINE})
setup.WaitWithDefaultTimeout()
Expect(setup).Should(Exit(0))
@@ -114,7 +112,6 @@ var _ = Describe("Podman rmi", func() {
})
It("podman rmi image that is a parent of another image", func() {
- SkipIfRemote()
session := podmanTest.PodmanNoCache([]string{"rmi", "-fa"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -153,7 +150,6 @@ var _ = Describe("Podman rmi", func() {
})
It("podman rmi image that is created from another named imaged", func() {
- SkipIfRemote()
session := podmanTest.PodmanNoCache([]string{"rmi", "-fa"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
diff --git a/test/e2e/start_test.go b/test/e2e/start_test.go
index a7a9e7fdb..b8198a3a9 100644
--- a/test/e2e/start_test.go
+++ b/test/e2e/start_test.go
@@ -40,7 +40,6 @@ var _ = Describe("Podman start", func() {
})
It("podman start single container by id", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"create", "-d", ALPINE, "ls"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -51,7 +50,6 @@ var _ = Describe("Podman start", func() {
})
It("podman container start single container by id", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"container", "create", "-d", ALPINE, "ls"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -63,7 +61,6 @@ var _ = Describe("Podman start", func() {
})
It("podman container start single container by short id", func() {
- Skip(v2remotefail)
session := podmanTest.Podman([]string{"container", "create", "-d", ALPINE, "ls"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -123,12 +120,11 @@ var _ = Describe("Podman start", func() {
})
It("podman failed to start with --rm should delete the container", func() {
- SkipIfRemote()
- session := podmanTest.Podman([]string{"create", "-it", "--rm", ALPINE, "foo"})
+ session := podmanTest.Podman([]string{"create", "--name", "test1", "-it", "--rm", ALPINE, "foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- start := podmanTest.Podman([]string{"start", "-l"})
+ start := podmanTest.Podman([]string{"start", "test1"})
start.WaitWithDefaultTimeout()
Expect(start).To(ExitWithError())
@@ -136,12 +132,11 @@ var _ = Describe("Podman start", func() {
})
It("podman failed to start without --rm should NOT delete the container", func() {
- SkipIfRemote()
session := podmanTest.Podman([]string{"create", "-it", ALPINE, "foo"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- start := podmanTest.Podman([]string{"start", "-l"})
+ start := podmanTest.Podman([]string{"start", session.OutputToString()})
start.WaitWithDefaultTimeout()
Expect(start).To(ExitWithError())
diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go
index 8e49e3bd0..cd78a54e1 100644
--- a/test/e2e/stop_test.go
+++ b/test/e2e/stop_test.go
@@ -217,7 +217,6 @@ var _ = Describe("Podman stop", func() {
})
It("podman stop all containers with one created", func() {
- Skip(v2remotefail)
session := podmanTest.RunTopContainer("test1")
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"})
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats
index 5fc07acfb..71595f419 100644
--- a/test/system/001-basic.bats
+++ b/test/system/001-basic.bats
@@ -23,7 +23,7 @@ function setup() {
is "${lines[0]}" "Version:[ ]\+[1-9][0-9.]\+" "Version line 1"
is "$output" ".*Go Version: \+" "'Go Version' in output"
- is "$output" ".*RemoteAPI Version: \+" "API version in output"
+ is "$output" ".*API Version: \+" "API version in output"
}
diff --git a/test/system/200-pod.bats b/test/system/200-pod.bats
index f3d278826..e3643a3bd 100644
--- a/test/system/200-pod.bats
+++ b/test/system/200-pod.bats
@@ -147,8 +147,7 @@ function random_ip() {
pod_id="$output"
# Check --pod-id-file
- # FIXME: broken in master; reenable once #6292 is fixed
- #is "$(<$pod_id_file)" "$pod_id" "contents of pod-id-file"
+ is "$(<$pod_id_file)" "$pod_id" "contents of pod-id-file"
# Check each of the options
if ! is_rootless; then
diff --git a/vendor/github.com/containers/common/pkg/config/default.go b/vendor/github.com/containers/common/pkg/config/default.go
index 7debd2984..185ce8cee 100644
--- a/vendor/github.com/containers/common/pkg/config/default.go
+++ b/vendor/github.com/containers/common/pkg/config/default.go
@@ -476,10 +476,11 @@ func (c *Config) Ulimits() []string {
// PidsLimit returns the default maximum number of pids to use in containers
func (c *Config) PidsLimit() int64 {
if unshare.IsRootless() {
- cgroup2, _ := cgroupv2.Enabled()
- if cgroup2 {
- return c.Containers.PidsLimit
- } else {
+ if c.Engine.CgroupManager == SystemdCgroupsManager {
+ cgroup2, _ := cgroupv2.Enabled()
+ if cgroup2 {
+ return c.Containers.PidsLimit
+ }
return 0
}
}
diff --git a/vendor/github.com/containers/common/pkg/config/libpodConfig.go b/vendor/github.com/containers/common/pkg/config/libpodConfig.go
index 89566f789..a8e4c9c93 100644
--- a/vendor/github.com/containers/common/pkg/config/libpodConfig.go
+++ b/vendor/github.com/containers/common/pkg/config/libpodConfig.go
@@ -246,20 +246,6 @@ func readLibpodConfigFromFile(path string, config *ConfigFromLibpod) (*ConfigFro
return nil, fmt.Errorf("unable to decode configuration %v: %v", path, err)
}
- // For the sake of backwards compat we need to check if the config fields
- // with *Set suffix are set in the config. Note that the storage-related
- // fields are NOT set in the config here but in the storage.conf OR directly
- // by the user.
- if config.VolumePath != "" {
- config.VolumePathSet = true
- }
- if config.StaticDir != "" {
- config.StaticDirSet = true
- }
- if config.TmpDir != "" {
- config.TmpDirSet = true
- }
-
return config, err
}
@@ -350,40 +336,75 @@ func (c *Config) libpodConfig() *ConfigFromLibpod {
func (c *Config) libpodToContainersConfig(libpodConf *ConfigFromLibpod) {
- c.Containers.InitPath = libpodConf.InitPath
+ if libpodConf.InitPath != "" {
+ c.Containers.InitPath = libpodConf.InitPath
+ }
c.Containers.LogSizeMax = libpodConf.MaxLogSize
c.Containers.EnableLabeling = libpodConf.EnableLabeling
- c.Engine.SignaturePolicyPath = libpodConf.SignaturePolicyPath
+ if libpodConf.SignaturePolicyPath != "" {
+ c.Engine.SignaturePolicyPath = libpodConf.SignaturePolicyPath
+ }
c.Engine.SetOptions = libpodConf.SetOptions
- c.Engine.VolumePath = libpodConf.VolumePath
- c.Engine.ImageDefaultTransport = libpodConf.ImageDefaultTransport
- c.Engine.OCIRuntime = libpodConf.OCIRuntime
+ if libpodConf.VolumePath != "" {
+ c.Engine.VolumePath = libpodConf.VolumePath
+ }
+ if libpodConf.ImageDefaultTransport != "" {
+ c.Engine.ImageDefaultTransport = libpodConf.ImageDefaultTransport
+ }
+ if libpodConf.OCIRuntime != "" {
+ c.Engine.OCIRuntime = libpodConf.OCIRuntime
+ }
c.Engine.OCIRuntimes = libpodConf.OCIRuntimes
c.Engine.RuntimeSupportsJSON = libpodConf.RuntimeSupportsJSON
c.Engine.RuntimeSupportsNoCgroups = libpodConf.RuntimeSupportsNoCgroups
c.Engine.RuntimePath = libpodConf.RuntimePath
c.Engine.ConmonPath = libpodConf.ConmonPath
c.Engine.ConmonEnvVars = libpodConf.ConmonEnvVars
- c.Engine.CgroupManager = libpodConf.CgroupManager
- c.Engine.StaticDir = libpodConf.StaticDir
- c.Engine.TmpDir = libpodConf.TmpDir
+ if libpodConf.CgroupManager != "" {
+ c.Engine.CgroupManager = libpodConf.CgroupManager
+ }
+ if libpodConf.StaticDir != "" {
+ c.Engine.StaticDir = libpodConf.StaticDir
+ }
+ if libpodConf.TmpDir != "" {
+ c.Engine.TmpDir = libpodConf.TmpDir
+ }
c.Engine.NoPivotRoot = libpodConf.NoPivotRoot
c.Engine.HooksDir = libpodConf.HooksDir
- c.Engine.Namespace = libpodConf.Namespace
- c.Engine.InfraImage = libpodConf.InfraImage
- c.Engine.InfraCommand = libpodConf.InfraCommand
+ if libpodConf.Namespace != "" {
+ c.Engine.Namespace = libpodConf.Namespace
+ }
+ if libpodConf.InfraImage != "" {
+ c.Engine.InfraImage = libpodConf.InfraImage
+ }
+ if libpodConf.InfraCommand != "" {
+ c.Engine.InfraCommand = libpodConf.InfraCommand
+ }
+
c.Engine.EnablePortReservation = libpodConf.EnablePortReservation
- c.Engine.NetworkCmdPath = libpodConf.NetworkCmdPath
+ if libpodConf.NetworkCmdPath != "" {
+ c.Engine.NetworkCmdPath = libpodConf.NetworkCmdPath
+ }
c.Engine.NumLocks = libpodConf.NumLocks
c.Engine.LockType = libpodConf.LockType
- c.Engine.EventsLogger = libpodConf.EventsLogger
- c.Engine.EventsLogFilePath = libpodConf.EventsLogFilePath
- c.Engine.DetachKeys = libpodConf.DetachKeys
+ if libpodConf.EventsLogger != "" {
+ c.Engine.EventsLogger = libpodConf.EventsLogger
+ }
+ if libpodConf.EventsLogFilePath != "" {
+ c.Engine.EventsLogFilePath = libpodConf.EventsLogFilePath
+ }
+ if libpodConf.DetachKeys != "" {
+ c.Engine.DetachKeys = libpodConf.DetachKeys
+ }
c.Engine.SDNotify = libpodConf.SDNotify
c.Engine.CgroupCheck = libpodConf.CgroupCheck
- c.Network.NetworkConfigDir = libpodConf.CNIConfigDir
+ if libpodConf.CNIConfigDir != "" {
+ c.Network.NetworkConfigDir = libpodConf.CNIConfigDir
+ }
c.Network.CNIPluginDirs = libpodConf.CNIPluginDir
- c.Network.DefaultNetwork = libpodConf.CNIDefaultNetwork
+ if libpodConf.CNIDefaultNetwork != "" {
+ c.Network.DefaultNetwork = libpodConf.CNIDefaultNetwork
+ }
}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index fb05b08d3..62bb5bc98 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -84,7 +84,7 @@ github.com/containers/buildah/pkg/secrets
github.com/containers/buildah/pkg/supplemented
github.com/containers/buildah/pkg/umask
github.com/containers/buildah/util
-# github.com/containers/common v0.11.2
+# github.com/containers/common v0.11.4
github.com/containers/common/pkg/apparmor
github.com/containers/common/pkg/auth
github.com/containers/common/pkg/capabilities
diff --git a/version/version.go b/version/version.go
index fe602d8e1..4c7202e77 100644
--- a/version/version.go
+++ b/version/version.go
@@ -6,7 +6,7 @@ package version
// bumped.
const Version = "2.0.0-dev"
-// RemoteAPIVersion is the version for the remote
+// APIVersion is the version for the remote
// client API. It is used to determine compatibility
// between a remote podman client and its backend
-const RemoteAPIVersion = 1
+const APIVersion = 1