I have inherited some cloud hosted vms, with several services hosted in docker containers on these. Think we server and then DB, both hosted in separate containers. Several (overpriced) vms are involved. Would really like some pointers as to how I can get into these / edit them. Would really like to consolidate. I use proxmox at home and am comfortable in Linux but this is new to me. Any docs / tutorials would be super helpful. Still don’t really understand why the design was done quite like this, so if you have insight on that, please let me know why you would do it this way. Thanks!

      • awderon@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Docker inspect $container should return you most of the info for the container. You can also get a shell inside the container via docker exec -it $container sh. If you have a dockerfile for the container you can see how the container has been set up.

        Additionally the shell history can also yield useful information on what has been done. Docker saves the logs of running containers in /var/lib/docker/containers

        • bretti_kivi@sopuli.xyzOP
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          thanks, super-useful. I think I will bring up a couple of docker containers at home and check where and what they log, then try and extrapolate from that. I’ve managed to get into a couple of them with the -it command.

  • Possibly linux@lemmy.zip
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    What is being hosted in the containers? What os is being run?

    Honestly I would stand up a Debian VMin your homelab with docker compose and play around

  • terny@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    You usually want to prioritize changing the container’s build config instead of getting into them and modifying them. Much better to get into the mindset of them not being pets you have to nurture.

    Separating the different services into containers is overall a good practice but having the DB in one can be a pain as it’s easier to work with stateless applications. The isolation aspect is very valuable as its easier to debug a problem. I would look into container orchestration if there isn’t already and making sure logs are centralized first.

    • bretti_kivi@sopuli.xyzOP
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      okay, that makes a lot of sense. I can’t see any immediate orchestration, but maybe I’m looking in the wrong place. would the logs go to /var/log on the main system? just realized I haven’t looked for those (d’oh!)

      • WASTECH@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Terny has the correct answer here OP. While I have never used Docker in an enterprise environment (manufacturing applications aren’t known for supporting any technology from the last decade at least), I have used Docker extensively in my home lab. You don’t want to modify the container itself, but the image it was created from. The data doesn’t reside in the container itself anyway, but typically a volume attached to the container (assuming it stores anything in the first place). Your best bet will be to figure out what image the container was created from, and modify the image. From there, you can update the existing containers to use the new image, or move them elsewhere if you like.

        You mentioned these VM’s are in the cloud. Depending on the hyperscaler, it is likely that you could migrate these to a native container service to save on cost since you wouldn’t have to pay for the overhead of a VM.