Getting the docker container id that a java app is running in

245 views
Skip to first unread message

Rick Holland

unread,
Dec 26, 2019, 2:31:10 PM12/26/19
to docker-java-dev
Using the docker-java lib is it possible for a java app to retrieve the container id of the container it is running in? (Or with any other lib?)

thnx

Danushka Herath

unread,
Dec 26, 2019, 11:27:43 PM12/26/19
to docker-java-dev
I think there's no feature like that in the java-docker lib, 
You can save some kind of metadata in the docker container as a label and query it via API,

Eg: 

When you create a docker container with your application attach a label with something unique to your application
After the container is up, search for that saved label.

Panagiotis Parthenis

unread,
Jan 15, 2020, 5:18:32 AM1/15/20
to docker-java-dev
Dear Rick, 

There is no lib that can accomplish that, but with the right configuration, you can do it. Just follow these steps :

1. Create a Java application which is using `docker-java` (link)

2. Containerized your Java application.

3. Execute your docker container with the specific name and  passing though the host Docker socket as volume
 `docker run -name test -v /var/run/docker.sock:/var/run/docker.sock java/app:1.0.0`

Then you can use the host docker engine, inside your container, so retrieve container's Id using container's name

Best regards, 
Panagiotis Parthenis

Dre Jackson

unread,
May 16, 2024, 9:40:55 PM5/16/24
to docker-java-dev
IF you're interested in exploring the world of psychedelic mushrooms, you may be wondering if it's possible to buy shrooms online. 
Visit the telegram channel below ;


With a large selection of products to meet our clients' demands, Buy Psychedelics Online Shop is your go-to online drug store. We work hard to provide the best Legal Psychedelics For Sale Online and ship our goods internationally from everywhere.


 All of the items mentioned on our website are in stock. When you email us your request, anticipate that your order will be completed right away. Buy Psychedelics is a reputable & top rated online Psychedelic dispensary with over 10,000 heartfelt customer reviews from satisfied customers. We are experts in magic mushrooms and other psychedelic drugs. 


Whether you’re experimenting with psychedelic drugs, looking for a great trip or you’re ready to dive deeper in unlocking your mind, you have come to the right place.

green solution

unread,
May 28, 2024, 12:49:13 PM5/28/24
to docker-java-dev

Are you looking to buy Quality weed for both Stoners and patients, RSO Oil for Cancer  patients,Pain, Anxiety pills, depression Medications and Research Chemicals for research purposes? Look no further! We guarantee the best  quality and authenticity of our products with a 99.99% assurance. In addition, you can also purchase legal hallucinogens, Anxiety or Stress meds at a fair price.

The Weedman  Group is making it possible so all patients in all communities can be able to benefit from their best medical supplies and contant medication supply all over the United States. Our stores are open to help you get all your medical needs without any delay. Ship worldwide (USPS, FedEx, Aramex, UPS, and DHL.


https://t.me/bignugs/782
https://t.me/bignugs/780
https://t.me/bignugs/777
https://t.me/bignugs/761
https://t.me/bignugs/757
https://t.me/bignugs/744
https://t.me/bignugs/739
https://t.me/bignugs/736
https://t.me/bignugs/733
https://t.me/bignugs/729
https://t.me/bignugs/716
https://t.me/bignugs/699
https://t.me/bignugs/694
https://t.me/bignugs/693
https://t.me/bignugs/684
https://t.me/bignugs/661
https://t.me/bignugs/656
https://t.me/bignugs/655
https://t.me/bignugs/654
https://t.me/bignugs/653
https://t.me/bignugs/647
https://t.me/bignugs/643
https://t.me/bignugs/646
https://t.me/bignugs/626
https://t.me/bignugs/627?single
https://t.me/bignugs/616?single
https://t.me/bignugs/615?single
https://t.me/bignugs/611?single
https://t.me/bignugs/608?single
https://t.me/bignugs/618?single
https://t.me/bignugs/605?single
https://t.me/bignugs/599?single
https://t.me/bignugs/603?single
https://t.me/bignugs/606?single
https://t.me/bignugs/594?single
https://t.me/bignugs/592?single
https://t.me/bignugs/591?single
https://t.me/bignugs/589?single
https://t.me/bignugs/588?single
https://t.me/bignugs/587?single
https://t.me/bignugs/586?single
https://t.me/bignugs/583?single
https://t.me/bignugs/580?single
https://t.me/bignugs/579?single https://t.me/bignugs/585?single
https://t.me/bignugs/577?single
https://t.me/bignugs/574?single
https://t.me/bignugs/575?single
https://t.me/bignugs/571?single
https://t.me/bignugs/567?single
https://t.me/bignugs/563?single
https://t.me/bignugs/560?single
https://t.me/bignugs/551?single
https://t.me/bignugs/550?single
https://t.me/bignugs/548?single
https://t.me/bignugs/549?single
https://t.me/bignugs/533?single
https://t.me/bignugs/529?single
https://t.me/bignugs/524?single
https://t.me/bignugs/523?single
https://t.me/bignugs/525?single
https://t.me/bignugs/528?single
https://t.me/bignugs/518?single
https://t.me/bignugs/495?single
https://t.me/bignugs/492?single
https://t.me/bignugs/497?single
https://t.me/bignugs/467?single
Reply all
Reply to author
Forward
0 new messages