Announcement

Collapse
No announcement yet.

experience with Docker?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • experience with Docker?

    Does anyone have experience with Docker? How do you reboot an image?

    I'm trying to make a new image for a small server, based on a Debian image on a Windows server (yes, native linux containers on Windows!).

    I pull the Debian image, start a container, run the install script for the small server in the container (*) and commit it as a new image. From this new image I can start a container, but the server does not run. FWIW, it also did not run prior to the commit (at (*)), so I suspect it has to do with starting the service in the container.

    The install script should add it such that it is automatically started after a reboot, but I don't know how to reboot an image... Any ideas?
    pixar
    Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

  • #2
    Originally posted by VJ View Post
    Does anyone have experience with Docker? How do you reboot an image?

    I'm trying to make a new image for a small server, based on a Debian image on a Windows server (yes, native linux containers on Windows!).

    I pull the Debian image, start a container, run the install script for the small server in the container (*) and commit it as a new image. From this new image I can start a container, but the server does not run. FWIW, it also did not run prior to the commit (at (*)), so I suspect it has to do with starting the service in the container.

    The install script should add it such that it is automatically started after a reboot, but I don't know how to reboot an image... Any ideas?
    docker stop <container name/ID> && docker start <container name/ID> ?

    Not entirely sure why you would want to restart a container though.. ideally it's a fire&forget, and once you have an updated container you retire the old one and just launch the updated image. All persistent date should be stored outside the container.

    Comment


    • #3
      Yes, that was what I did... so perhaps my problem is elsewhere... The reason I wanted to restart is that after installation of the software, a reboot is recommended (if you install it on a real system).

      It rather seems my problem is in getting the software installed in the container and getting it up and running. It all seems to go fine, the software installs without any errors or warnings, but still I cannot connect to it (the software uses a web-based interface), I've set the ports to access it, but my client never seems to connect to it...

      Guess I'll have to try further... Thanks!
      pixar
      Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

      Comment


      • #4
        Originally posted by VJ View Post
        Yes, that was what I did... so perhaps my problem is elsewhere... The reason I wanted to restart is that after installation of the software, a reboot is recommended (if you install it on a real system).

        It rather seems my problem is in getting the software installed in the container and getting it up and running. It all seems to go fine, the software installs without any errors or warnings, but still I cannot connect to it (the software uses a web-based interface), I've set the ports to access it, but my client never seems to connect to it...

        Guess I'll have to try further... Thanks!
        can you curl or telnet from the host?

        I set up mailcow dockerized and it's working wonderfully for a month now.

        Comment


        • #5
          That should work... but it is so basic that I have not tried it... I suspect it will go if I open the port, as I start from a Debian pull. For sure something to try.

          I was suspecting that I cannot get the installed service from the server to start as I was not sure how to reboot it... but then again a reboot is recommended, not required so it should work even before I try to make it into an image. And it does not... I'll check again if I have all network things correct, as some network modes don't work for linux containers on Windows; the telnet test would be a perfect test for that.
          pixar
          Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

          Comment


          • #6
            Originally posted by VJ View Post
            That should work... but it is so basic that I have not tried it... I suspect it will go if I open the port, as I start from a Debian pull. For sure something to try.

            I was suspecting that I cannot get the installed service from the server to start as I was not sure how to reboot it... but then again a reboot is recommended, not required so it should work even before I try to make it into an image. And it does not... I'll check again if I have all network things correct, as some network modes don't work for linux containers on Windows; the telnet test would be a perfect test for that.
            Linux containers on Windows? Can you elaborate on that?
            Are you saying that you're not running them in a regular Linux VM or through Kubernetes-as-a-service?

            Comment


            • #7
              I completed my switch to Linux this year. One personal laptop dual boots, everything else is Windows free.

              Comment


              • #8
                Originally posted by dZeus View Post
                Linux containers on Windows? Can you elaborate on that?
                Are you saying that you're not running them in a regular Linux VM or through Kubernetes-as-a-service?
                The Windows 2004 update introduced WSL2: https://docs.microsoft.com/en-us/win...s-new-in-wsl-2
                In WSL1, docker used a virtual machine in Hyper-V for running linux containers. In WSL2, they can run natively on Windows ( https://docs.docker.com/docker-for-windows/wsl/ ), barring some restrictions.

                In the Microsoft App store, you can find different Linuxe flavours (Debian, Ubuntu, ...) which you can install and can assign for use by Docker.

                Currently, you cannot run GUI apps in WSL2 (unless you redirect to an X server which can be on your Windows), but Microsoft is working on adding support for that.

                (yes, hell froze over )
                pixar
                Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

                Comment


                • #9
                  What are the limitations with Docker on WSL2, other than GUI? (which is an unlikely but not impossible candidate for Docker containers in the first place)
                  Afaik, WSL2 runs a native Linux kernel virtualized on top of Hyper-V, unlike WSL1 which didn't use any virtualization at all (and probably completely unrelated to the docker implementation alongside it).

                  Since you're running with Hyper-V enabled, you may also consider running another Linux VM for a more 'native' container hosting experience if the WSL2 kernel and userland is too limiting.

                  Comment


                  • #10
                    Originally posted by dZeus View Post
                    What are the limitations with Docker on WSL2, other than GUI? (which is an unlikely but not impossible candidate for Docker containers in the first place)
                    Afaik, WSL2 runs a native Linux kernel virtualized on top of Hyper-V, unlike WSL1 which didn't use any virtualization at all (and probably completely unrelated to the docker implementation alongside it).
                    Host network mode does not work on Docker for Windows. So perhaps it is not so much a limitation of WSL2, but it is a limitation you have with Linux host on Windows compared to Linux host on Linux.
                    All about exposing containers on the Docker host's network


                    There are also more restrictions in which devices you can map:

                    The --device option is only supported on process-isolated Windows containers. This option fails if the container isolation is hyperv or when running Linux Containers on Windows (LCOW).
                    I don't know if this is fixed in WSL2 though.


                    Originally posted by dZeus View Post
                    Since you're running with Hyper-V enabled, you may also consider running another Linux VM for a more 'native' container hosting experience if the WSL2 kernel and userland is too limiting.
                    My problem is that the server I want to run is a music server, which can be woken up from the network (not possible if it is a pure VM) and which also prevents the host to go to sleep while music is playing (preventing the VM from sleeping does not prevent the host from sleeping). As it is a linux-only server, I am trying to get it to work in Docker. But I'm very early in learning Docker, so for sure at the moment it is not working because I'm doing something wrong.
                    pixar
                    Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

                    Comment


                    • #11
                      You can also get vps from 3 EUR/month on hetzner.

                      I had major pains with hyperv and Linux networking while teaching a course this week.

                      Comment


                      • #12
                        Originally posted by UtwigMU View Post
                        You can also get vps from 3 EUR/month on hetzner.

                        I had major pains with hyperv and Linux networking while teaching a course this week.
                        Hyper-V used to prevent the CPU going into deep sleep modes, unlike a Type-2 hypervisor like VirtualBox or VMWare Workstation when not running any VMs.
                        Not sure if this is still true today, but if it is, I would not recommend using Hyper-V on laptops unless you're intending to run your VMs permanently on, and power usage is comparable with type-2 hypervisors.

                        Comment


                        • #13
                          You can Disable Processor C-States in The BIOS for older Type 2 Hypervisors. VMware has several Tunables in ESXi and Workstation v15+
                          Hey, Donny! We got us a German who wants to die for his country... Oblige him. - Lt. Aldo Raine

                          Comment


                          • #14
                            I've tried a bit over the weekend, and suspect a big problem for the install-script is the lack of systemd in Docker. Installling it does not help, as the container itself is not using it.

                            The thing is: I want the server to go to sleep, but I also want it to wake up on a wake-on-lan. I thought that this meant that the server has to have the same IP as the host (thus ruling out a true VM), but I found in the weekend that I can define port-forwarding on a Hyper-V switch. So I could actually install it on a true VM, define a virtual switch that forwards the ports from the host and direct all the clients to the IP of the host rather than to the VM directly. WOL should work as it is sent to the host, and the services offered should work through the port fowarding.
                            Does this make sense?
                            This does solve the waking up part, but it does not solve the "prevent the server to sleep while a client plays music" issue. However, I can resolve that one as well, as I can detect in the host if music is playing and use some tool to reset the sleep timer as long as that is the case.
                            pixar
                            Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

                            Comment


                            • #15
                              What is the problem that you are trying to solve?

                              Are you installing media server?
                              Are you installing it on your personal PC or your local Windows server?

                              You might want to try raspberry or a inexpensive x86 mini ITX or mATX pc with Linux or ESX to host your services.

                              Comment

                              Working...
                              X