Installing docker for mac, going through the settings and such briefly
Docker gives you this command to run from Docker for Mac.
docker run -d -p 80:80 docker/getting-started
Alias tip: d run -d -p 80:80 docker/getting-startedUnable to find image 'docker/getting-started:latest' locallylatest: Pulling from docker/getting-startedcbdbe7a5bc2a: Pull complete85434292d1cb: Pull complete75fcb1e58684: Pull complete2a8fe5451faf: Pull complete42ceeab04dd4: Pull completebdd639f50516: Pull completec446f16e1123: Pull completeDigest: sha256:79d5eae6e7b1dec2e911923e463240984dad111a620d5628a5b95e036438b2dfStatus: Downloaded newer image for docker/getting-started:latest54d2062e3a31f77e0ac473f4d4e6b3b0a3c3e5e2d5d5dcfddc6124f9844fd35d
It doesn't look like it does anything but it pulls the image, creates a container, starts the container, and daemonizes it. If we look at Docker for Mac, we can see it running along with some logs, etc.
You can continue to use the GUI with the caveat that you can't do everything with the GUI. We'll be covering the CLI in this course.
"running a container" involves many steps. When we do a
docker run docker first needs to check to see if the image to create the container from is available locally. If it's not, the docker engine will pull the image to your computer before creating and starting a container based on that image.
We just said we can start containers, so can we stop them? What happens when we stop them? How do we restart them?
By default, Docker Hub owns the default namespace. This means if we go to Docker Hub we can find the list of official images. These images are often databases, but also contain different language and frameworks like Golang or node.js to different applications like WordPress.