Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Cannot run docker topon user containers. #2340

Closed
bribass opened this issue Apr 29, 2018 · 7 comments
Closed

Cannot run docker topon user containers. #2340

bribass opened this issue Apr 29, 2018 · 7 comments
Assignees
Milestone

Comments

@bribass
Copy link

bribass commented Apr 29, 2018

RancherOS Version: (ros os version) v1.3.0

Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.) bare metal

It is not possible to run docker top to see what processes are running inside a non-system container.

rancher@gamma:~$ docker run -dt alpine cat
5f319428bd574629f847b659df0209345ae78200264376b5612a58c8632fba1
rancher@gamma:~$ docker top 5f319428bd57
Error response from daemon: Error running ps: exec: "ps": executable file not found in $PATH

Note that I can successfully run sudo system-docker top docker, which implies that there's a ps executable available to the system, but not to user-docker.

This makes it so that my Jenkins pipelines (that I'm trying to move to this new ROS box) will not be able to run their docker.image().inside {} steps. (Jenkins is using this container start with cat, using top to check that it started, and then running commands in this container with exec calls.)

@kuhnroyal
Copy link

kuhnroyal commented Apr 30, 2018

Exactly same problem for me, just wanted to add an issue for this as well.

Also I just noted, that this is a problem with the ubuntu console only. I tried the default console and it works. However I need the ubuntu console to install some additional tools, git etc.

Edit:
This also happens with debian and alpine console, only default seems to work. I would guess it fails with all but the default.

@bribass
Copy link
Author

bribass commented May 1, 2018

Nice catch! I can confirm that I was using the debian console, and that by switching back to default, docker top works as expected.

@inthroxify
Copy link

inthroxify commented May 15, 2018

If anyone would like a workaround:

sudo ln -s /bin/ps /usr/bin/ps

@niusmallnan niusmallnan added this to the v1.5.0 milestone Jun 22, 2018
@niusmallnan
Copy link
Contributor

This has been fixed in ROS v1.4.0.

[root@ip-172-31-26-213 rancher]# ros -v
version v1.4.0 from os image rancher/os:v1.4.0

[root@ip-172-31-26-213 rancher]# docker run -d --name test nginx
54d78d61a01c9ce79f12784475ed88c548a6d600e356bf0c5ece16849bf6dfac
[root@ip-172-31-26-213 rancher]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
54d78d61a01c        nginx               "nginx -g 'daemon ..."   3 seconds ago       Up 2 seconds        80/tcp              test
[root@ip-172-31-26-213 rancher]# docker top test
PID                 USER                COMMAND
2109                root                nginx: master process nginx -g daemon off;
2134                101                 nginx: worker process

@niusmallnan niusmallnan removed this from the v1.5.0 milestone Jul 26, 2018
@olljanat
Copy link
Contributor

@niusmallnan looks that this issue still exists on v1.4.1 😢
and workaround told by @inthroxify is still needed.

@niusmallnan
Copy link
Contributor

Reopen it, I may miss something.

@rootwuj
Copy link

rootwuj commented Nov 22, 2018

I verified all consoles and docker top works fine as expected.
Fixed in rancher/os:v1.5.0-rc1.

@rootwuj rootwuj closed this as completed Nov 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants