Unsolved Trying to use docker but have no idea what I'm doing...
-
I've installed docker and did run
docker run hello-world
to verify it's working.Now I trying to install a CAS server (Central Authentication Service) for testing.
docker pull apereo/cas
pulls down the latest image and it completed successfully.But what now? How can I check that whatever I pulled down is running? Or do I have to start it somehow?
-
@Pete-S You need to run it with
docker start apereo/cas
Also note that Docker containers don't automatically start after a reboot. -
@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?
-
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
-
@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.
-
if you pass
--restart always
it should restart the container after a system reboot. -
@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.
-
@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.
-
@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? -
@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.
-
@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.
-
@Pete-S @travisdh1, maybe start with main page here: https://docker-curriculum.com
-
@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.
-
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.
-
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.