-2

I started to use Docker on my app, but I've got a problem in iTerm2. I split pane in iTerm, and now, on my first pane docker ps -a returns a list of containers, but on my second pane, the same command returns an empty list.

I can't run any containers from second pane, I can do it only using my first pane. Is this normal? How can I 'see' my containers on every pane which I create?

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
PFurman
  • 11

2 Answers2

1

This sounds like you are using Docker Toolbox (aka docker-machine).

Docker Toolbox relies on certain environment variables being set in your shell in order to function. In your second shell, those variables are not properly set.

You can set them like this:

eval "$(docker-machine env default)"

This is assuming your docker-machine is named default. If yours is not, use the proper name. If you don't know what it is named, you can list the machines using docker-machine ls.

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
-1

maybe using different versions of shell. check it by running ps -ef $$

kyserslick
  • 591
  • 1
  • 10
  • 27