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 doesn't work well #65202

Closed
pinage404 opened this issue Jul 20, 2019 · 12 comments · Fixed by #85604
Closed

podman doesn't work well #65202

pinage404 opened this issue Jul 20, 2019 · 12 comments · Fixed by #85604

Comments

@pinage404
Copy link
Contributor

Issue description

I'm trying podman, it doesn't work (or i need to configure something and i don't know what / how)

Steps to reproduce

nix-shell --packages podman --command fish
these paths will be fetched (7.33 MiB download, 32.29 MiB unpacked):
  /nix/store/gj6bq2s52l9vgzl0wp0d37jvm2l2zcjg-podman-1.0.0-bin
  /nix/store/rgrwcdir1kbc95rk3igbj5pyk5qm56r9-podman-1.0.0
  /nix/store/zqabb6j60agkcqp5izyqm12gl5k7spcf-bash-interactive-4.4-p23-dev
copying path '/nix/store/zqabb6j60agkcqp5izyqm12gl5k7spcf-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/gj6bq2s52l9vgzl0wp0d37jvm2l2zcjg-podman-1.0.0-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/rgrwcdir1kbc95rk3igbj5pyk5qm56r9-podman-1.0.0' from 'https://cache.nixos.org'...

podman --version
WARN[0000] unable to find /etc/containers/registries.conf. some podman (image shortnames) commands may be limited
podman version 1.0.0

podman info
WARN[0000] unable to find /etc/containers/registries.conf. some podman (image shortnames) commands may be limited
ERRO[0000] No subuid ranges found for user "pinage404" in /etc/subuid

podman run alpine
WARN[0000] unable to find /etc/containers/registries.conf. some podman (image shortnames) commands may be limited
error creating libpod runtime: could not find a working binary (configured options: [/usr/bin/runc /usr/sbin/runc /usr/local/bin/runc /usr/local/sbin/runc /sbin/runc /bin/runc /usr/lib/cri-o-runc/sbin/runc]): invalid argument

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

  • system: "x86_64-linux"
  • host os: Linux 4.19.58, NixOS, 19.03.173094.5f707e8e06f (Koi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2.2
  • channels(pinage404): "home-manager-19.03, nixos-19.03.173160.e199c174c69, nixos-unstable-19.09pre185259.362be9608c3"
  • channels(root): "nixos-19.03.173094.5f707e8e06f"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
@periklis
Copy link
Contributor

periklis commented Jul 21, 2019

You can add the required etc configuration files to your environment:

{ config, pkgs, ... }:
{
  environment = {
    etc."containers/registries.conf".text = import ./etc/containers/registries.nix {};
    etc."containers/policy.json".text     = import ./etc/containers/policy.nix {};
  };
}

I use nix for generating my configuration in /etc, e.g.

{}:''
[registries.search]
registries = ['docker.io', 'quay.io', "gcr.io", "eu.gcr.io"]
''

@pinage404
Copy link
Contributor Author

I added etc."containers/registries.conf" and etc."containers/policy.json"

But i still have the problem

sudo podman info
[sudo] Mot de passe de pinage404 :
could not get runtime: could not find a working binary (configured options: [/usr/bin/runc /usr/sbin/runc /usr/local/bin/runc /usr/local/sbin/runc /sbin/runc /bin/runc /usr/lib/cri-o-runc/sbin/runc]): invalid argument

It seems normal that podman can't find thoses paths under NixOS

But i don't know how you can run it without any other configuration


I found this in man 'libpod.conf'

 runtime_path=""
         Paths to search for a valid OCI runtime binary

But i don't know how to get the nix store path of runc

@xaverdh
Copy link
Contributor

xaverdh commented Jul 22, 2019

runc has its own package. You can get the store path to the binary via "${pkgs.runc.bin}/bin/runc".

@periklis
Copy link
Contributor

You can amend your ~/.config/containers/libpod.conf:

conmon_path = ["/run/current-system/sw/bin/conmon", "/usr/libexec/podman/conmon", "/usr/libexec/crio/conmon", "/usr/local/lib/podman/conmon", "/usr/local/libexec/crio/conmon", "/usr/bin/conmon", "/usr/sbin/conmon", "/usr/lib/crio/bin/conmon"]
conmon_env_vars = ["PATH=/run/current-system/sw/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"]

[runtimes]
  runc = ["/run/current-system/sw/bin/runc", "/usr/bin/runc", "/usr/sbin/runc", "/usr/local/bin/runc", "/usr/local/sbin/runc", "/sbin/runc", "/bin/runc", "/usr/lib/cri-o-runc/sbin/runc"]

In addition, you will probably need to install: runc, conmon and slirp4netns.

@pinage404
Copy link
Contributor Author

it seems to not work

───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /home/pinage404/.config/containers/libpod.conf
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ conmon_path = ["/run/current-system/sw/bin/conmon", "/usr/libexec/podman/conmon", "/usr/libexec/crio/conmon", "/usr/local/lib/podman/conmon", "/usr/local/libexec/crio/conmon", "/u
       │ sr/bin/conmon", "/usr/sbin/conmon", "/usr/lib/crio/bin/conmon"]
   2   │ conmon_env_vars = ["PATH=/run/current-system/sw/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"]
   3   │
   4   │ [runtimes]
   5   │   runc = ["/run/current-system/sw/bin/runc", "/usr/bin/runc", "/usr/sbin/runc", "/usr/local/bin/runc", "/usr/local/sbin/runc", "/sbin/runc", "/bin/runc", "/usr/lib/cri-o-runc/sbin
       │ /runc"]
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
nix-shell --command "podman info" --packages podman runc conmon slirp4netns
could not get runtime: could not find a working binary (configured options: [/usr/bin/runc /usr/sbin/runc /usr/local/bin/runc /usr/local/sbin/runc /sbin/runc /bin/runc /usr/lib/cri-o-runc/
sbin/runc]): invalid argument

@rawkode
Copy link
Member

rawkode commented Aug 2, 2019

I'm having the same problems with podman. Why doesn't this work out of the box?

@saschagrunert
Copy link
Member

saschagrunert commented Aug 18, 2019

We would need a configuration wrapper for podman, which is currently under development in #54925

@VanCoding
Copy link

Is it possible to use podman inside a nix-shell, without requiring it to be installed globally?
Together with podman-compose, that would be a awesome and make docker & docker-compose obsolete.

@x80486
Copy link

x80486 commented Sep 22, 2019

I know most of you (if not all) are referring to NixOS here, but since the package is also available for Linux, I'm wondering if this should also cover running podman correctly as well under that operating system.

I just installed it and I'm getting something similar:

[x80486@uplink ~]$ uname -a
Linux uplink 4.19.73-1-lts #1 SMP Mon Sep 16 17:15:25 CEST 2019 x86_64 GNU/Linux
[x80486@uplink ~]$ podman version
Version:            1.5.1
RemoteAPI Version:  1
Go Version:         go1.12.9
OS/Arch:            linux/amd64
[x80486@uplink ~]$ podman info
Error: could not get runtime: could not find a working conmon binary (configured options: [/usr/libexec/podman/conmon /usr/local/lib/podman/conmon /usr/bin/conmon /usr/sbin/conmon /usr/local/bin/conmon /usr/local/sbin/conmon /run/current-system/sw/bin/conmon]): invalid argument
WARN[0000] unable to find /home/x80486/.config/containers/registries.conf. some podman (image shortnames) commands may be limited
[x80486@uplink ~]$ podman ps -a
Error: could not get runtime: could not find a working conmon binary (configured options: [/usr/libexec/podman/conmon /usr/local/lib/podman/conmon /usr/bin/conmon /usr/sbin/conmon /usr/local/bin/conmon /usr/local/sbin/conmon /run/current-system/sw/bin/conmon]): invalid argument
WARN[0000] unable to find /home/x80486/.config/containers/registries.conf. some podman (image shortnames) commands may be limited 

@mat8913
Copy link
Contributor

mat8913 commented Nov 21, 2019

@VanCoding

Is it possible to use podman inside a nix-shell, without requiring it to be installed globally?

Yes it is, nix-shell -p podman conmon runc slirp4netns. The only global configuration I had to do was set up subuids and subgids for my account.

@adisbladis
Copy link
Member

adisbladis commented Nov 26, 2019

I made a shell.nix that's completely self-contained for running podman: https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947.
It also maps the docker command to podman within the shell.

The only thing you have to setup globally is the subuid/subgid ranges for your user.

@danieldk
Copy link
Contributor

danieldk commented Mar 1, 2020

For some reason configuration files in ~/.config often break and podman expects them in /etc/containers. So, I have started running podman in an FHS:

https://github.com/danieldk/nix-home/blob/master/overlays/20-podman.nix

So far, so good...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants