Discussion:
[docker] new user, need help
Larry Martell
2016-03-09 01:53:45 UTC
Permalink
I have inherited a docker based system, and I can't make heads or tails of
it. The person who set it up is gone and no one here know anything about
it. All I have it a short readme that says to run this (the names have been
changed to protect the guilty):

sudo docker run -v /home/user1/repos/foo:/home/user2/src -v
/projects/foo:/home/user2/data -p 127.0.0.1:40180:80 -p
127.0.0.1:48000:8000 -p 45820:5820 -t -i user2/foo bash

When I run this I am told the app works, but here are my questions:

What exactly does this command do?
/home/user2 does not exist - how does that effect the working of the app?
How would I look at log files?

Thanks!
Ranjib Dey
2016-03-09 03:48:38 UTC
Permalink
this command starts a new container with directories mounted from host to
container (-v flag), as well as forwards port from container to host (-p).
the volume mounts (-v) will create the directories inside the container if
it does not exist. it is expected that the apps inside container will log
in STDOUT which can be viewed by `docker log` command.
try out the help pages/documentation related to docker, they should help a
lot.
best
ranjib
Post by Larry Martell
I have inherited a docker based system, and I can't make heads or tails of
it. The person who set it up is gone and no one here know anything about
it. All I have it a short readme that says to run this (the names have been
sudo docker run -v /home/user1/repos/foo:/home/user2/src -v
/projects/foo:/home/user2/data -p 127.0.0.1:40180:80 -p 127.0.0.1:48000:8000
-p 45820:5820 -t -i user2/foo bash
What exactly does this command do?
/home/user2 does not exist - how does that effect the working of the app?
How would I look at log files?
Thanks!
Larry Martell
2016-03-09 07:50:30 UTC
Permalink
Thanks for the reply. I did look at the docs, but I didn't see where
they explained the -v A:B syntax. The docker logs command needs the
name of the container. What is that in my case?
Post by Ranjib Dey
this command starts a new container with directories mounted from host to
container (-v flag), as well as forwards port from container to host (-p).
the volume mounts (-v) will create the directories inside the container if
it does not exist. it is expected that the apps inside container will log in
STDOUT which can be viewed by `docker log` command.
try out the help pages/documentation related to docker, they should help a
lot.
best
ranjib
Post by Larry Martell
I have inherited a docker based system, and I can't make heads or tails of
it. The person who set it up is gone and no one here know anything about it.
All I have it a short readme that says to run this (the names have been
sudo docker run -v /home/user1/repos/foo:/home/user2/src -v
/projects/foo:/home/user2/data -p 127.0.0.1:40180:80 -p
127.0.0.1:48000:8000 -p 45820:5820 -t -i user2/foo bash
What exactly does this command do?
/home/user2 does not exist - how does that effect the working of the app?
How would I look at log files?
Thanks!
migor
2016-03-09 11:04:31 UTC
Permalink
Run 'docker ps ' to see running containers
Larry Martell
2016-03-09 18:48:55 UTC
Permalink
Thanks!
Post by migor
Run 'docker ps ' to see running containers
Loading...