You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: Docker for Mac and Windows have requirements for a fairly recent operating system version. If your machine does not meet these requirements, then you need to install https://www.docker.com/products/docker-toolbox[Docker Toolbox].
22
23
@@ -26,67 +27,38 @@ Complete set of operating systems are listed at http://docs.docker.com/engine/in
Skip this section if you are not using Docker Toolbox for Mac or Windows.
34
35
35
36
. *Default Docker Machine*: Docker Toolbox creates a Docker Machine named `default`. To make it easier to start/stop the containers, an entry is added into the host mapping table of your operating system.
36
37
+
37
-
Find out IP address of your machine:
38
+
Find out the IP address of your Docker Machine:
38
39
+
39
-
```console
40
+
```
40
41
docker-machine ip default
41
42
```
42
43
+
43
44
This will provide the IP address associated with the Docker Machine created by Toolbox.
44
45
+
45
-
. *Docker CLI Shell*: Any Docker CLI command needs to be issued from the Terminal or Command Prompt where `eval $(docker-machine env default)` command was issued. This will make sure Docker CLI is configured to talk to the VM created by Docker Toolbox.
46
-
47
-
=== Setup Host Mapping
48
-
49
-
For Linux, Docker host is running on local machine and so the IP address would be `127.0.0.1`.
50
-
51
-
Edit `/etc/hosts` (Mac OS or Linux) or `C:\Windows\System32\drivers\etc\hosts` (Windows) and add:
46
+
Edit `/etc/hosts` (Mac OS) or `C:\Windows\System32\drivers\etc\hosts` (Windows) and add:
52
47
53
48
[source, text]
54
49
----
55
50
<IP ADDRESS> dockerhost
56
-
<IP ADDRESS> localhost
57
51
----
58
-
59
-
This allows to access Docker containers using `dockerhost` or `localhost`.
52
+
+
53
+
This allows to access Docker containers using `dockerhost`.
54
+
+
55
+
. *Docker CLI Shell*: Any Docker CLI command needs to be issued from the Terminal or Command Prompt where `eval $(docker-machine env default)` command was issued. This will make sure Docker CLI is configured to talk to the VM created by Docker Toolbox.
60
56
61
57
=== Download Images
62
58
63
59
This tutorial uses a few Docker images and software. Let's download them before we start the tutorial.
64
60
65
-
Create a new file, name it `docker-compose-pull-images.yml`, and add the following content:
66
-
67
-
[source, text]
68
-
----
69
-
ubuntu:
70
-
image: ubuntu
71
-
busybox:
72
-
image: busybox
73
-
openjdk:
74
-
image: openjdk
75
-
wildfly:
76
-
image: jboss/wildfly
77
-
mysql:
78
-
image: mysql
79
-
javaee7-hol:
80
-
image: arungupta/javaee7-hol
81
-
swarm:
82
-
image: swarm
83
-
wildfly-couchbase-javaee7:
84
-
image: arungupta/wildfly-couchbase-javaee7
85
-
couchbase:
86
-
image: arungupta/couchbase
87
-
----
88
-
89
-
Give the command to pull all the images:
61
+
Download the file from https://github.com/docker/labs/blob/master/developer-tools/java/scripts/docker-compose-pull-images.yml and give the command to pull all the images:
Copy file name to clipboardExpand all lines: developer-tools/java/chapters/ch02-basic-concepts.adoc
+14-41
Original file line number
Diff line number
Diff line change
@@ -24,12 +24,12 @@ Docker has three main components:
24
24
. __Containers__ are the *run component* of Docker and created from images. Containers can be run, started, stopped, moved, and deleted.
25
25
. Images are stored, shared, and managed in a __registry__ and are the *distribution component* of Docker. Docker Hub is a publicly available registry and is available at http://hub.docker.com.
26
26
27
-
In order for these three components to work together, the *Docker Daemon* runs on a host machine and does the heavy lifting of building, running, and distributing Docker containers. In addition, the *Client* is a Docker binary which accepts commands from the user and communicates back and forth with the Daemon.
27
+
In order for these three components to work together, the *Docker Daemon*(or Docker Engine) runs on a host machine and does the heavy lifting of building, running, and distributing Docker containers. In addition, the *Client* is a Docker binary which accepts commands from the user and communicates back and forth with the Engine.
28
28
29
29
.Docker architecture
30
30
image::docker-architecture.png[]
31
31
32
-
The Client communicates with a Daemon that is either co-located on the same host or on a different host. Use the `pull` command on the Client to request the Daemon to pull an image from the registry. The Daemon then downloads the image from Docker Hub, or whichever registry is configured. Multiple images can be downloaded from the registry and installed on the Daemon host. To run an Image, use the `run`command on the Client to request the Daemon to create a container on-demand based on the image.
32
+
The Client communicates with the Engine that is either co-located on the same host or on a different host. Client uses the `pull` command to request the Engine to pull an image from the registry. The Engine then downloads the image from Docker Hub, or whichever registry is configured. Multiple images can be downloaded from the registry and installed on the Engine. Client uses the `run`run the container.
33
33
34
34
**How does a Docker Image work?**
35
35
@@ -68,57 +68,30 @@ Check if your client is working using the following command:
68
68
69
69
It shows the output:
70
70
71
-
Docker version 1.12.0-rc3, build 91e29e8, experimental
71
+
Docker version 1.13.0, build 49bf474
72
72
73
73
NOTE: The exact version may differ based upon how recently the installation was performed.
74
74
75
75
The exact version of Client and Server can be seen using `docker version` command. This shows the output as:
76
76
77
77
```
78
78
Client:
79
-
Version: 1.12.0-rc3
80
-
API version: 1.24
81
-
Go version: go1.6.2
82
-
Git commit: 91e29e8
83
-
Built: Sat Jul 2 00:09:24 2016
79
+
Version: 1.13.0
80
+
API version: 1.25
81
+
Go version: go1.7.3
82
+
Git commit: 49bf474
83
+
Built: Wed Jan 18 16:20:26 2017
84
84
OS/Arch: darwin/amd64
85
-
Experimental: true
86
85
87
86
Server:
88
-
Version: 1.12.0-rc3
89
-
API version: 1.24
90
-
Go version: go1.6.2
91
-
Git commit: 876f3a7
92
-
Built: Tue Jul 5 02:20:13 2016
87
+
Version: 1.13.0
88
+
API version: 1.25 (minimum version 1.12)
89
+
Go version: go1.7.3
90
+
Git commit: 49bf474
91
+
Built: Wed Jan 18 16:20:26 2017
93
92
OS/Arch: linux/amd64
94
93
Experimental: true
95
94
```
96
95
97
-
The common commands that'll be used are:
98
-
99
-
. `run` - runs a container
100
-
. `ps`- lists containers
101
-
. `stop` - stops a container
102
-
. `rm` - Removes a container
103
-
104
-
Get a full list of available commands with
105
-
106
-
docker
107
-
108
-
A more commonly used list of commands is available at <<Common_Docker_Commands>>.
109
-
110
-
### Verify Docker Configuration
111
-
112
-
Verify that host mapping is configured correctly by using the command `ping dockerhost`. This resolves to the IP address of where the Docker Host is running. You should see an output as:
113
-
114
-
[source, text]
115
-
----
116
-
> ping dockerhost
117
-
PING dockerhost (127.0.0.1): 56 data bytes
118
-
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.035 ms
119
-
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.078 ms
120
-
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.059 ms
121
-
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.058 ms
122
-
----
96
+
The complete set of commands can be seen using `docker --help`.
0 commit comments