Docker Client - communicates with Docker Server/Engine/Daemon

      1. Communicates with Docker Engine (Daemon/Server) which manages containers & images
      2. Can use CLI (docker quickstart terminal) or Kitematic (GUI) to interface with docker client. The docker client is the “terminal” for how we communicate with Docker Engine/Daemon/Server
        1. Docker Quickstart Terminal
          1. Provisions a Docker-Machine (a Linux VM. Docker_Host)
          2. Each Docker-Machine is a lightweight Linux Virtual Machine/Box
          3. opens docker client terminal which is communicating w/docker-server (CLI prints out “whale” icon)

.

## ## ==

## ## ## ## ===

/"""""""""""""""""___/ ===

~ { ~~ ~ ~~ ~ ~ / ===- ~~~

__ o __/

\ \ __/

___/

docker is configured to use default machine w/ IP 192.168.99.100

$

IP 192.168.99.100 = ip address of linux virtual machine

      1. Active docker-machine is called Docker_Host. This is the environment which hosts the Docker Server that docker client is communicating with
        1. To see which docker-machine’s daemon that the client is attached to
          1. $ docker-machine ls → (* = “active”)
        2. Connect/change client to the daemon in any docker-machine
          1. $ docker-machine env [docker-machine-name]

List environment variables of DM.

Gives you IP address & command to point Docker Client to that IP

Pointing Docker Client to a DM’s IP makes it the DOCKER_HOST

          1. $ eval $(docker-machine env name-of-docker-machine)
        • Connect docker client to swarm:

$ eval $(docker-machine env -swarm name-of-swarm-master)

Terminal: Docker Quickstart Terminal: Returns a docker client terminal that is connected to daemon inside active docker-machine (indicated by *)

          1. Manually connect docker client to desired docker-machine

$ eval $(docker-machine env name-of-docker-machine)

          1. $ docker-machine ls will show “active”
  • = docker client is currently communicating with this docker-machine/server

Can run docker server in daemon mode or interactive mode

        1. Daemon simply means program runs in the background.
        2. Interactive simply means human user is inputting each command
        3. Framework for thinking about interactive vs daemon
          1. YES: Docker Server is currently running a program loaded into it. How do I interact directly w/docker server to manually give it some commands to run
          2. YES: "How do I enter/exit interactive mode
          3. YES: “How do I return to daemon mode"

ctrl-p & then ctrl-q

http://stackoverflow.com/questions/25267372/correct-way-to-detach-from-a-container-without-stopping-it

          1. NO "How do I enter/exit the container"

Interactive flags

          1. -i → interactive
          2. -t → creates psuedo TTY with stdin & stdout

TTY = TeleType Writer (originally for deaf people) tele comes from a Greek root meaning far or distant. TTY's provide a virtual interface similar to what the physical machines provided. This is the origin of the 80 char width and carriage return

Examples

          1. $ docker run -t -i busybox:1.24

Gives you terminal inside the container. Prompt looks like / #

/ # exit → returns to Daemon mode & SHUTS DOWN CONTAINER

OR:

ctrl-p & then ctrl-q → returns to daemon & KEEPS CONTAINER running.

          1. To enter interactive mode once container running …

$ docker exec -it <cont_id> command

exec lets you run a command inside a running container

-it → enter interactive mode

bash → run bash shell

Example → $ docker exec -it 175c bash

See Running programs → $ ps axu

(ps axu is just a shell command)

Exit interactive mode (& return to daemon mode) → ctrl-p & ctrl-q

          1. “Daemon” Terminology

In multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user. Traditionally, the process names of a daemon end with the letter d. For example, syslogd is the daemon that implements the system logging facility, and sshd is a daemon that serves incoming SSH connections.

Why called daemon?

The term was coined by the programmers of MIT's Project MAC. They took the name from Maxwell's demon, an imaginary being from a thought experiment that constantly works in the background, sorting molecules. Unix systems inherited this terminology. Maxwell's Demon is consistent with Greek mythology's interpretation of a daemon as a supernatural being working in the background, with no particular bias towards good or evil. However, BSD and some of its derivatives have adopted a Christian demon as their mascot rather than a Greek daemon.

The word daemon is an alternative spelling of demon and is pronounced /ˈdiːmən/ dee-mən.

Alternate terms for daemon are service

After the term was adopted for computer use, it was rationalized as a "backronym" for Disk And Execution MONitor.

  1. Docker Interactions

Screen Shot 2016-10-16 at 7.45.42 AM.png

results matching ""

    No results matching ""