Docker Community Forums

Share and learn in the Docker community.

How do I find a named image started with the ‘–volumes-from’ flag?

ref: http://www.catosplace.net/blog/2015/02/11/running-jenkins-in-docker-containers/

[tldr]
pulling jenkins: docker pull jenkins
make a named data volume: docker create -v /var/jenkins_home --name jenkins-dv jenkins
using a data volume container: docker run -d -p 8080:8080 --volumes-from jenkins-dv --name myjenkins jenkins

so now I can: docker start myjenkins & docker stop myjenkins

but if I forget that I named it myjenkins – how can I find it?

docker images - returns the image jenkins, which i cannot start
docker inspect jenkins – doesn’t mention myjenkins
docker inspect myjenkins – shows that it exists

but how do I find it if I forgot what I named it ?

docker ps -a |grep jenkins will show you all containers which either use the jenkins image or have a name with jenkins in it.

thanks !!

there’s no way to add a label to something after it’s been created is there?

if it’s a name you want, you can rename containers.

docker rename $(docker ps -lq) myjenkins

will rename the latest created container to myjenkins

rename is cool, but there is no relabel

docker relabel
docker: ‘relabel’ is not a docker command.