Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman save oci-dir produces non-OCI layout #6544

Closed
nishakm opened this issue Jun 9, 2020 · 4 comments · Fixed by #6814
Closed

Podman save oci-dir produces non-OCI layout #6544

nishakm opened this issue Jun 9, 2020 · 4 comments · Fixed by #6814
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@nishakm
Copy link

nishakm commented Jun 9, 2020


BUG REPORT INFORMATION

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

podman save --format oci-dir -o existing_dir does not produce a OCI layout of the blobs in the existing_dir directory. I am not sure if this is by design, in which case, it would be nice to name this option differently.

Steps to reproduce the issue:

$ mkdir podman_debian_dir
$ podman save --format oci-dir -o podman_debian_dir debian:latest

Describe the results you received:

The layout of the results look like this:

$ ls -al
total 116436
drwxr-xr-x 2 nisha nisha      4096 Jun  9 07:06 .
drwxr-xr-x 4 nisha nisha      4096 Jun  9 07:05 ..
-rw-r--r-- 1 nisha nisha       579 Jun  9 07:06 42f7b5ed30dd502a394c6377a72e2e07e198c145e3bb749c780262d84bfa990e
-rw-r--r-- 1 nisha nisha 119207936 Jun  9 07:06 8803ef42039dcbe936755e9baae4bb7b19cb0fb6a438eb3992950cd0afef8e4f
-rw-r--r-- 1 nisha nisha       350 Jun  9 07:06 manifest.json
-rw-r--r-- 1 nisha nisha        33 Jun  9 07:06 version

Describe the results you expected:

I would expect the layout to be the same as when you do:

$ podman save --format oci-archive -o debian.tar debian:latest
$ tar xvf debian.tar -C podman_debian_dir

Like:

$ ls -al
total 20
drwxr-xr-x 3 nisha nisha 4096 Jun  9 06:49 .
drwxr-xr-x 4 nisha nisha 4096 Jun  9 07:05 ..
drwxr-xr-x 3 nisha nisha 4096 Jun  9 06:49 blobs
-rw-r--r-- 1 nisha nisha  274 Jun  9 06:49 index.json
-rw-r--r-- 1 nisha nisha   31 Jun  9 06:49 oci-layout

Output of podman version:

$ podman version
Version:            1.9.3
RemoteAPI Version:  1
Go Version:         go1.10.1
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  gitCommit: ""
  goVersion: go1.10.1
  podmanVersion: 1.9.3
host:
  arch: amd64
  buildahVersion: 1.14.9
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.16, commit: '
  cpus: 2
  distribution:
    distribution: ubuntu
    version: "18.04"
  eventLogger: file
  hostname: ubuntu
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.3.0-53-generic
  memFree: 789159936
  memTotal: 4098334720
  ociRuntime:
    name: runc
    package: 'containerd.io: /usr/bin/runc'
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc10
      commit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
      spec: 1.0.1-dev
  os: linux
  rootless: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 0.4.3
      commit: unknown
  swapFree: 1349640192
  swapTotal: 2147479552
  uptime: 149h 1m 52.11s (Approximately 6.21 days)
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/nisha/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: vfs
  graphOptions: {}
  graphRoot: /home/nisha/.local/share/containers/storage
  graphStatus: {}
  imageStore:
    number: 2
  runRoot: /run/user/1000
  volumePath: /home/nisha/.local/share/containers/storage/volumes

Package info (e.g. output of rpm -q podman or apt list podman):

$ apt list podman
Listing... Done
podman/unknown,now 1.9.3~1 amd64 [installed]

Additional environment details (AWS, VirtualBox, physical, etc.):
VMware Fusion VM

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 9, 2020
@mheon
Copy link
Member

mheon commented Jun 9, 2020

@mtrmac PTAL

@mtrmac
Copy link
Collaborator

mtrmac commented Jun 9, 2020

That’s a long-standing typo (maintained through two different refactorings ): https://github.com/containers/libpod/blob/fbe09d78e91c9ac5cadc8b00a67c7d7f89d64868/libpod/image/image.go#L1478 is not creating an OCI format at all; it should be using c/image/oci/layout.NewReference.

@rhatdan
Copy link
Member

rhatdan commented Jun 10, 2020

@mtrmac I got a fix for this. but when I try to load the image, I am getting

#./bin/podman save --format oci-dir -o /tmp/dan alpine
# ls -latr /tmp/dan/
total 8
drwxrwxrwt. 41 root root 1320 Jun 10 15:44 ..
drwxr-xr-x.  3 root root   60 Jun 10 15:44 blobs
-rw-r--r--.  1 root root   31 Jun 10 15:44 oci-layout
-rw-r--r--.  1 root root  247 Jun 10 15:44 index.json
drwxr-xr-x.  3 root root  100 Jun 10 15:44 .
# ./bin/podman load -i /tmp/dan alpine
  open /tmp/dan/manifest.json: no such file or directory
Error: error pulling "alpine": unable to pull dir:/tmp/dan: Error determining manifest MIME type for dir:/tmp/dan: open /tmp/dan/manifest.json: no such file or directory

Is Podman doing something wrong?

@mtrmac
Copy link
Collaborator

mtrmac commented Jun 11, 2020

Is Podman doing something wrong?

Depends, let’s concentrate the discussion in the PR. See #6562 (comment) .

QiWang19 added a commit to QiWang19/podman that referenced this issue Jul 9, 2020
- fix saving&loading oci format. Close containers#6544
- support loading using image name without "localhost/" prefix when reading from ociarchive/dir saved from this semantics

Signed-off-by: Daniel J Walsh <[email protected]>
Signed-off-by: Qi Wang <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants