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
Copy file name to clipboardExpand all lines: beginner/chapters/setup.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,11 @@
4
4
There are no specific skills needed for this tutorial beyond a basic comfort with the command line and using a text editor. Prior experience in developing web applications will be helpful but is not required. As you proceed further along the tutorial, we'll make use of [Docker Hub](https://hub.docker.com/).
5
5
6
6
### Setting up your computer
7
-
Getting all the tooling setup on your computer can be a daunting task, but thankfully getting Docker up and running on your favorite OS has become very easy.
7
+
Getting all the tooling setup on your computer can be a daunting task, but getting Docker up and running on your favorite OS has become very easy.
8
8
9
-
The *getting started* guide on Docker has detailed instructions for setting up Docker on [Mac](https://docs.docker.com/v1.11/engine/installation/mac/), [Linux](https://docs.docker.com/v1.11/engine/installation/linux/) and [Windows](https://docs.docker.com/v1.11/engine/installation/windows/).
9
+
The *getting started* guide on Docker has detailed instructions for setting up Docker on [Mac](https://docs.docker.com/docker-for-mac/), [Linux](https://docs.docker.com/engine/installation/linux/) and [Windows](https://docs.docker.com/docker-for-windows/).
10
+
11
+
*Important note* If you're using an older version of Windows or MacOS you may need to use [Docker Machine](https://docs.docker.com/machine/overview/) instead.
10
12
11
13
Once you are done installing Docker, test your Docker installation by running the following:
Copy file name to clipboardExpand all lines: beginner/chapters/votingapp.md
+5-13Lines changed: 5 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,21 @@
2
2
This portion of the tutorial will guide you through the creation and customization of a voting app. It's important that you follow the steps in order, and make sure to customize the portions that are customizable.
3
3
4
4
**Important.**
5
-
To complete the submission, you will need to have Docker and Docker Compose installed on your machine as mentioned in the [Setup](./setup.md) section. You'll also need to have a [Docker Id](https://hub.docker.com/register/). Once you do run login from the commandline:
5
+
To complete this section, you will need to have Docker and Docker Compose installed on your machine as mentioned in the [Setup](./setup.md) section. You'll also need have git installed. There are many options for installing it. For instance, you can get it from [GitHub](https://help.github.com/articles/set-up-git/).
6
+
7
+
You'll also need to have a [Docker Id](https://hub.docker.com/register/). Once you do run login from the commandline:
6
8
7
9
```
8
10
$ docker login
9
11
```
10
12
11
13
And follow the login directions. Now you can push images to Docker Hub.
12
14
13
-
> Note: If you encounter an error response from daemon while attempting to login, you may need to restart your machine by running `docker-machine restart <YOUR_DOCKER_MACHINE_NAME>`.
14
-
15
15
16
16
### 3.1 Get the voting-app
17
17
You now know how to build your own Docker image, so let's take it to the next level and glue things together. For this app you have to run multiple containers and Docker Compose is the best way to do that.
18
18
19
-
Start by quickly reading the documentation available [here](https://docs.docker.com/compose/overview/).
19
+
Start by quickly reading the documentation [here](https://docs.docker.com/compose/overview/).
20
20
21
21
Clone the voting-app repository already available at [Github Repo](https://github.com/docker/example-voting-app.git).
22
22
@@ -116,15 +116,7 @@ To launch your app navigate to the example-voting-app directory and run the foll
116
116
$ docker-compose up -d
117
117
```
118
118
119
-
This tells Compose to start all the containers specified in the `docker-compose.yml` file. The `-d` tells it to run them in daemon mode, in the background.
120
-
121
-
Last you'll need to figure out the ip address of your Docker host. If you're running Linux, it's just localhost, or 127.0.0.1. If you're using Docker Machine on Mac or Windows, you'll need to run:
122
-
123
-
```
124
-
$ docker-machine ip default
125
-
```
126
-
127
-
It'll return an IP address. If you only have one Docker Machine running, most likely, that's 192.168.99.100. We'll call that `<YOUR_IP_ADDRESS>`. Navigate to `http://<YOUR_IP_ADDRESS>:5000` in your browser, and you'll see the voting app, something like this:
119
+
This tells Compose to start all the containers specified in the `docker-compose.yml` file. The `-d` tells it to run them in daemon mode, in the background. Navigate to `http://localhost:5000` in your browser, and you'll see the voting app, something like this:
Copy file name to clipboardExpand all lines: beginner/chapters/webapps.md
+8-10Lines changed: 8 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The image that you are going to use is a single-page website that was already cr
12
12
$ docker run -d seqvence/static-site
13
13
```
14
14
15
-
>**Note:** The current version of this image doesn't run without the `-d` flag, although it should. The `-d` flag enables **detached mode**, which detaches the running container from the terminal/shell and returns your prompt after the container starts. We are debugging the problem with this image but for now, use `-d` even for this first example.
15
+
>**Note:** The current version of this image doesn't run without the `-d` flag. The `-d` flag enables **detached mode**, which detaches the running container from the terminal/shell and returns your prompt after the container starts. We are debugging the problem with this image but for now, use `-d` even for this first example.
16
16
17
17
So, what happens when you run this command?
18
18
@@ -65,15 +65,15 @@ $ docker port static-site
65
65
80/tcp -> 0.0.0.0:32773
66
66
```
67
67
68
-
If you are running [Docker for Mac](https://docs.docker.com/docker-for-mac/), [Docker for Windows](https://docs.docker.com/docker-for-windows/), or Docker on Linux, you can open `http://localhost:YOUR_PORT_FOR 80/tcp`. For our example this is `http://localhost:32773`.
68
+
If you are running [Docker for Mac](https://docs.docker.com/docker-for-mac/), [Docker for Windows](https://docs.docker.com/docker-for-windows/), or Docker on Linux, you can open `http://localhost:[YOUR_PORT_FOR 80/tcp]`. For our example this is `http://localhost:32773`.
69
69
70
70
If you are using Docker Machine on Mac or Windows, you can find the hostname on the command line using `docker-machine` as follows (assuming you are using the `default` machine).
71
71
72
72
```
73
73
$ docker-machine ip default
74
74
192.168.99.100
75
75
```
76
-
You can now open `http://<YOUR_IPADDRESS>:YOUR_PORT_FOR 80/tcp` to see your site live! For our example, this is: `http://192.168.99.100:32773`.
76
+
You can now open `http://<YOUR_IPADDRESS>:[YOUR_PORT_FOR 80/tcp]` to see your site live! For our example, this is: `http://192.168.99.100:32773`.
77
77
78
78
You can also run a second webserver at the same time, specifying a custom host port mapping to the container's webserver.
I'm sure you agree that was super simple. To deploy this on a real server you would just need to install Docker, and run the above `docker` command.
85
+
To deploy this on a real server you would just need to install Docker, and run the above `docker` command.
86
86
87
-
Now that you've seen how to run a webserver inside a Docker image, you must be wondering - how do I create my own Docker image? This is the question we'll explore in the next section.
87
+
Now that you've seen how to run a webserver inside a Docker image, how do you create your own Docker image? This is the question we'll explore in the next section.
88
88
89
89
But first, let's stop and remove the containers since you won't be using them anymore.
90
90
@@ -130,14 +130,12 @@ The above gives a list of images that I've pulled from the registry and the ones
130
130
131
131
For simplicity, you can think of an image akin to a git repository - images can be [committed](https://docs.docker.com/engine/reference/commandline/commit/) with changes and have multiple versions. When you do not provide a specific version number, the client defaults to `latest`.
132
132
133
-
For example, you can pull a specific version of `ubuntu` image as follows:
133
+
For example you could pull a specific version of `ubuntu` image as follows:
134
134
135
135
```
136
136
$ docker pull ubuntu:12.04
137
137
```
138
138
139
-
**NOTE**: Do not execute the above command. It is only for your reference.
140
-
141
139
If you do not specify the version number of the image, then as mentioned the Docker client will default to a version named `latest`.
142
140
143
141
So for example, the `docker pull` command given below will pull an image named `ubuntu:latest`:
@@ -146,7 +144,7 @@ So for example, the `docker pull` command given below will pull an image named `
146
144
$ docker pull ubuntu
147
145
```
148
146
149
-
To get a new Docker image you can either get it from a registry (such as the docker hub) or create your own. There are tens of thousands of images available on [Docker hub](https://hub.docker.com). You can also search for images directly from the command line using `docker search`.
147
+
To get a new Docker image you can either get it from a registry (such as the docker hub) or create your own. There are hundreds of thousands of images available on [Docker hub](https://hub.docker.com). You can also search for images directly from the command line using `docker search`.
150
148
151
149
An important distinction to be aware of when it comes to images is between base and child images.
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
399
397
```
400
398
401
-
Head over to `http://<DOCKER_HOST-IP-ADDRESS>:8888` and your app should be live. You may need to open up another terminal and determine the container ip address using `docker-machine ip default`.
399
+
Head over to `http://localhost:8888` and your app should be live. **note** If you are using Docker Machine, you may need to open up another terminal and determine the container ip address using `docker-machine ip default`.
0 commit comments