this post was submitted on 25 Jul 2023
22 points (92.3% liked)

Sysadmin

5532 readers
4 users here now

A community dedicated to the profession of IT Systems Administration

founded 5 years ago
MODERATORS
 

Hi! I've inherited a machine installed by somebody else who's no longer in the company or the country. The machine is running just fine, but i see no Dockerfiles or docker-compose.yml, and this looks like something that came from a Compose file with a few linked containers.

Is it possible to reconstruct that info from the running containers? I'm still a raw Docker newbie at this point so i don't know if this is even possible, would be helpful not to have to try and contact the person who set it up.

top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 13 points 1 year ago* (last edited 1 year ago)

You can use docker inspect command to dump any meaningful info about the running containers. You can get details about networking, images etc.

Also you can check systemd units (or whatever your system uses) in case they are used to launch containers or docker compose files.

Running ps you should also be ablen to see if docker-compose is used, and in general this uses standard names (docker-compose.yml/.yaml), so you can simply find / -name those.

[–] [email protected] 10 points 1 year ago (1 children)
[–] [email protected] 3 points 1 year ago

Looks like a really interesting project, might need to tell a few people about this

[–] [email protected] 1 points 1 year ago

Well you can at least connect to the running container with a shell and see what processes are running, and maybe copy some binaries and config out of it into the local file system.

You can also use $ docker inspect to get some more info.

[–] [email protected] 1 points 1 year ago

docker inspect <container_id> tells you everything about the container in json format.

[–] [email protected] 1 points 1 year ago

The other comments on this thread had nailed it down but there may be some commands you will need as well, so the command "history" has a journal of what command was ran at what time.

load more comments
view more: next ›