diff options
-rw-r--r-- | cmd/podman/common/specgen.go | 6 | ||||
-rw-r--r-- | docs/source/markdown/podman-login.1.md | 4 | ||||
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 4 | ||||
-rw-r--r-- | pkg/api/server/docs.go | 25 | ||||
-rw-r--r-- | test/e2e/images_test.go | 11 | ||||
-rw-r--r-- | vendor/github.com/containers/common/pkg/auth/auth.go | 11 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
8 files changed, 54 insertions, 11 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index fee9d8c7b..2a5ebea3c 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -385,11 +385,7 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string } s.Annotations = annotations - workDir := "/" - if wd := c.Workdir; len(wd) > 0 { - workDir = wd - } - s.WorkDir = workDir + s.WorkDir = c.Workdir entrypoint := []string{} userCommand := []string{} if c.Entrypoint != nil { diff --git a/docs/source/markdown/podman-login.1.md b/docs/source/markdown/podman-login.1.md index a69b311eb..79c7ff640 100644 --- a/docs/source/markdown/podman-login.1.md +++ b/docs/source/markdown/podman-login.1.md @@ -12,7 +12,9 @@ and password. If the registry is not specified, the first registry under [regist from registries.conf will be used. **podman login** reads in the username and password from STDIN. The username and password can also be set using the **username** and **password** flags. The path of the authentication file can be specified by the user by setting the **authfile** -flag. The default path used is **${XDG\_RUNTIME\_DIR}/containers/auth.json**. +flag. The default path used is **${XDG\_RUNTIME\_DIR}/containers/auth.json**. If there is a valid +username and password in the **authfile** , Podman will use those existing credentials if the user does not pass in a username. +If those credentials are not present, Podman will then use any existing credentials found in **$HOME/.docker/config.json**. **podman [GLOBAL OPTIONS]** @@ -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.20200523094741-de0f541d9224 - github.com/containers/common v0.13.0 + github.com/containers/common v0.13.1 github.com/containers/conmon v2.0.17+incompatible github.com/containers/image/v5 v5.4.5-0.20200529084758-46b2ee6aebb0 github.com/containers/psgo v1.5.1 @@ -70,8 +70,8 @@ github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHV github.com/containers/buildah v1.14.9-0.20200523094741-de0f541d9224 h1:EqwBZRqyUYvU7JOmmSSPviSaAoUP1wN0cefXXDZ9ATo= github.com/containers/buildah v1.14.9-0.20200523094741-de0f541d9224/go.mod h1:5ZkWjOuK90yl55L5R+purJNLfUo0VUr8pstJazNtYck= github.com/containers/common v0.11.2/go.mod h1:2w3QE6VUmhltGYW4wV00h4okq1Crs7hNI1ZD2I0QRUY= -github.com/containers/common v0.13.0 h1:+7FHpPNz3YR2YcVIVNnPg2sVrXytxNgNHbd3n7SosL0= -github.com/containers/common v0.13.0/go.mod h1:LJlijBz9zi7pJqZvlbxCOsw6qNn31rzb7Zo6NBJNQxU= +github.com/containers/common v0.13.1 h1:6aE/IIxPPQk8DmND87tsWU1Aop/7mCC0T3dk/fZdm3k= +github.com/containers/common v0.13.1/go.mod h1:Kg9Enw+WOUa9pwx47fzxEdzOn5+ofYXjBJdCyaCeSSA= github.com/containers/conmon v2.0.17+incompatible h1:8BooocmNIwjOwAUGAoDD6fi3u0RrFyQ/fDkQzdiVtrI= github.com/containers/conmon v2.0.17+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I= github.com/containers/image/v5 v5.4.3/go.mod h1:pN0tvp3YbDd7BWavK2aE0mvJUqVd2HmhPjekyWSFm0U= diff --git a/pkg/api/server/docs.go b/pkg/api/server/docs.go index c989c7927..124c16092 100644 --- a/pkg/api/server/docs.go +++ b/pkg/api/server/docs.go @@ -4,6 +4,31 @@ // only as experimental as this point. The endpoints, parameters, inputs, and // return values can all change. // +// To start the service and keep it running for 5,000 seconds (-t 0 runs forever): +// +// podman system service -t 5000 & +// +// You can then use cURL on the socket using requests documented below. +// +// NOTE: if you install the package podman-docker, it will create a symbolic +// link for /var/run/docker.sock to /run/podman/podman.sock +// +// See podman-service(1) for more information. +// +// Quick Examples: +// +// 'podman info' +// +// curl --unix-socket /run/podman/podman.sock http://d/v1.0.0/libpod/info +// +// 'podman pull quay.io/containers/podman' +// +// curl -XPOST --unix-socket /run/podman/podman.sock -v 'http://d/v1.0.0/images/create?fromImage=quay.io%2Fcontainers%2Fpodman' +// +// 'podman list images' +// +// curl --unix-socket /run/podman/podman.sock -v 'http://d/v1.0.0/libpod/images/json' | jq +// // Terms Of Service: // // Schemes: http, https diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go index b16cff411..0ee7260c2 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -186,6 +186,17 @@ RUN apk update && apk add strace Expect(len(result.OutputToStringArray()) >= 1).To(BeTrue()) }) + It("podman images workingdir from image", func() { + dockerfile := `FROM docker.io/library/alpine:latest +WORKDIR /test +` + podmanTest.BuildImage(dockerfile, "foobar.com/workdir:latest", "false") + result := podmanTest.Podman([]string{"run", "foobar.com/workdir:latest", "pwd"}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(0)) + Expect(result.OutputToString()).To(Equal("/test")) + }) + It("podman images filter after image", func() { podmanTest.RestoreAllArtifacts() rmi := podmanTest.PodmanNoCache([]string{"rmi", "busybox"}) diff --git a/vendor/github.com/containers/common/pkg/auth/auth.go b/vendor/github.com/containers/common/pkg/auth/auth.go index 1aa9f8b31..c52dfa01f 100644 --- a/vendor/github.com/containers/common/pkg/auth/auth.go +++ b/vendor/github.com/containers/common/pkg/auth/auth.go @@ -232,11 +232,20 @@ func Logout(systemContext *types.SystemContext, opts *LogoutOptions, args []stri } err = config.RemoveAuthentication(systemContext, server) - switch err { + switch errors.Cause(err) { case nil: fmt.Fprintf(opts.Stdout, "Removed login credentials for %s\n", server) return nil case config.ErrNotLoggedIn: + authConfig, err := config.GetCredentials(systemContext, server) + if err != nil { + return errors.Wrapf(err, "error reading auth file") + } + authInvalid := docker.CheckAuth(context.Background(), systemContext, authConfig.Username, authConfig.Password, server) + if authConfig.Username != "" && authConfig.Password != "" && authInvalid == nil { + fmt.Printf("Not logged into %s with current tool. Existing credentials were established via docker login. Please use docker logout instead.\n", server) + return nil + } return errors.Errorf("Not logged into %s\n", server) default: return errors.Wrapf(err, "error logging out of %q", server) diff --git a/vendor/modules.txt b/vendor/modules.txt index a44d0e88d..a470e037f 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.13.0 +# github.com/containers/common v0.13.1 github.com/containers/common/pkg/apparmor github.com/containers/common/pkg/auth github.com/containers/common/pkg/capabilities |