ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Unsolved Trying to use docker but have no idea what I'm doing...

    IT Discussion
    docker
    4
    15
    840
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • travisdh1T
      travisdh1 @1337
      last edited by

      @Pete-S said in Trying to use docker but have no idea what I'm doing...:

      @travisdh1 said in Trying to use docker but have no idea what I'm doing...:

      @Pete-S You need to run it with docker start apereo/cas
      Also note that Docker containers don't automatically start after a reboot.

      I tried to run docker start apereo/cas but got the error below, which looks like it isn't there.

      Error response from daemon: No such container: apereo/cas
      Error: failed to start containers: apereo/cas
      

      But when I run docker images -a I have:

      REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
      hello-world         latest              bf756fb1ae65        5 months ago        13.3kB
      apereo/cas          latest              759874ee68a7        22 months ago       642MB
      

      Any suggestions?

      This is why I don't really like Docker. Too many issues exactly like this, and tracking them down is always a pain.

      stacksofplatesS 1 Reply Last reply Reply Quote 0
      • stacksofplatesS
        stacksofplates
        last edited by

        if you pass --restart always it should restart the container after a system reboot.

        1 Reply Last reply Reply Quote 1
        • stacksofplatesS
          stacksofplates @travisdh1
          last edited by

          @travisdh1 said in Trying to use docker but have no idea what I'm doing...:

          @Pete-S said in Trying to use docker but have no idea what I'm doing...:

          @travisdh1 said in Trying to use docker but have no idea what I'm doing...:

          @Pete-S You need to run it with docker start apereo/cas
          Also note that Docker containers don't automatically start after a reboot.

          I tried to run docker start apereo/cas but got the error below, which looks like it isn't there.

          Error response from daemon: No such container: apereo/cas
          Error: failed to start containers: apereo/cas
          

          But when I run docker images -a I have:

          REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
          hello-world         latest              bf756fb1ae65        5 months ago        13.3kB
          apereo/cas          latest              759874ee68a7        22 months ago       642MB
          

          Any suggestions?

          This is why I don't really like Docker. Too many issues exactly like this, and tracking them down is always a pain.

          Too many issues like what? It was the wrong command. Start only works if you have a container with that name already built.

          travisdh1T 1 Reply Last reply Reply Quote 0
          • travisdh1T
            travisdh1 @stacksofplates
            last edited by

            @stacksofplates said in Trying to use docker but have no idea what I'm doing...:

            @travisdh1 said in Trying to use docker but have no idea what I'm doing...:

            @Pete-S said in Trying to use docker but have no idea what I'm doing...:

            @travisdh1 said in Trying to use docker but have no idea what I'm doing...:

            @Pete-S You need to run it with docker start apereo/cas
            Also note that Docker containers don't automatically start after a reboot.

            I tried to run docker start apereo/cas but got the error below, which looks like it isn't there.

            Error response from daemon: No such container: apereo/cas
            Error: failed to start containers: apereo/cas
            

            But when I run docker images -a I have:

            REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
            hello-world         latest              bf756fb1ae65        5 months ago        13.3kB
            apereo/cas          latest              759874ee68a7        22 months ago       642MB
            

            Any suggestions?

            This is why I don't really like Docker. Too many issues exactly like this, and tracking them down is always a pain.

            Too many issues like what? It was the wrong command. Start only works if you have a container with that name already built.

            So what command is missing? I only remember the download and start from just about any install guide.

            stacksofplatesS 1 Reply Last reply Reply Quote 0
            • 1
              1337 @stacksofplates
              last edited by

              @stacksofplates said in Trying to use docker but have no idea what I'm doing...:

              It depends how you want to run it. If you want a completely ephemeral container just do docker run --rm -d apaero/cas

              If you want to keep the data between container restarts remove the --rm

              This worked well and I can see the docker image running with docker ps.

              Still there is suppose to be a webserver exposed and I can't find anything. Perhaps my problem now is network settings related.
              The docker host has an dhcp ip on 192.168.0.0/24 but it looks like docker images have their own private network 172.17.0.0/16.

              Am I assuming right that I have to do do something to expose the docker IP / ports to the LAN?
              Ideally I would want it to use the hosts IP.

              I found docker run -p is that what I should be looking at?

              stacksofplatesS 1 Reply Last reply Reply Quote 0
              • stacksofplatesS
                stacksofplates @1337
                last edited by

                @Pete-S said in Trying to use docker but have no idea what I'm doing...:

                @stacksofplates said in Trying to use docker but have no idea what I'm doing...:

                It depends how you want to run it. If you want a completely ephemeral container just do docker run --rm -d apaero/cas

                If you want to keep the data between container restarts remove the --rm

                This worked well and I can see the docker image running with docker ps.

                Still there is suppose to be a webserver exposed and I can't find anything. Perhaps my problem now is network settings related.
                The docker host has an dhcp ip on 192.168.0.0/24 but it looks like docker images have their own private network 172.17.0.0/16.

                Am I assuming right that I have to do do something to expose the docker IP / ports to the LAN?
                Ideally I would want it to use the hosts IP.

                I found docker run -p is that what I should be looking at?

                Oh i didn't realize there was a webserver. You need to expose the containers port.

                Yeah use -p to expose a port. So -p 8080:80 maps port 8080 on your system to port 80 in the container.

                1 Reply Last reply Reply Quote 1
                • stacksofplatesS
                  stacksofplates @travisdh1
                  last edited by

                  @travisdh1 said in Trying to use docker but have no idea what I'm doing...:

                  @stacksofplates said in Trying to use docker but have no idea what I'm doing...:

                  @travisdh1 said in Trying to use docker but have no idea what I'm doing...:

                  @Pete-S said in Trying to use docker but have no idea what I'm doing...:

                  @travisdh1 said in Trying to use docker but have no idea what I'm doing...:

                  @Pete-S You need to run it with docker start apereo/cas
                  Also note that Docker containers don't automatically start after a reboot.

                  I tried to run docker start apereo/cas but got the error below, which looks like it isn't there.

                  Error response from daemon: No such container: apereo/cas
                  Error: failed to start containers: apereo/cas
                  

                  But when I run docker images -a I have:

                  REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
                  hello-world         latest              bf756fb1ae65        5 months ago        13.3kB
                  apereo/cas          latest              759874ee68a7        22 months ago       642MB
                  

                  Any suggestions?

                  This is why I don't really like Docker. Too many issues exactly like this, and tracking them down is always a pain.

                  Too many issues like what? It was the wrong command. Start only works if you have a container with that name already built.

                  So what command is missing? I only remember the download and start from just about any install guide.

                  You have to run the container. Start only starts a stopped container.

                  1 Reply Last reply Reply Quote 1
                  • ObsolesceO
                    Obsolesce
                    last edited by

                    @Pete-S @travisdh1, maybe start with main page here: https://docker-curriculum.com

                    1 1 Reply Last reply Reply Quote 1
                    • 1
                      1337 @Obsolesce
                      last edited by

                      @Obsolesce said in Trying to use docker but have no idea what I'm doing...:

                      @Pete-S @travisdh1, maybe start with main page here: https://docker-curriculum.com

                      Thanks, I'll have a look at that.

                      1 Reply Last reply Reply Quote 0
                      • stacksofplatesS
                        stacksofplates
                        last edited by

                        If you don't want the Docker daemon running all of the time and you don't need the Docker socket, Podman is a nice alternative. The commands are identical (on purpose) and you can create pods like in K8s. You can even export your Pod configurations into a K8s deployment if you want.

                        1 Reply Last reply Reply Quote 3
                        • stacksofplatesS
                          stacksofplates
                          last edited by

                          Another advantage to application containers is integrations with things like VSCode. Your whole dev environment for a project can live in the container. It makes entry to helping with projects much easier. For example you can include a Dockerfile in your project and VSCode will build the container according to your Dockerfile. Then you can have VSCode spin up the container and attach to it and you can do the development inside of the container. That way the contributors don't need to install anything on their systems to work with your project. It's a really nice work flow.

                          1 Reply Last reply Reply Quote 1
                          • 1 / 1
                          • First post
                            Last post