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: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,34 +64,34 @@ KAGGLE_KEY=<your_kaggle_key>
64
64
65
65
This codebase is designed to be run with [Docker](https://docs.docker.com/get-docker/).
66
66
67
-
If you've never used Docker before, don't worry! I have included a guide to Docker in the [Docker README](./docs/docker.md) file in this repository. This includes a full run through of why Docker is awesome and a brief guide to the `Dockerfile` and `docker-compose.yml` for this project.
67
+
If you've never used Docker before, don't worry! I have included a guide to Docker in the [Docker README](./docs/docker.md) file in this repository. This includes a full run through of why Docker is awesome and a brief guide to the `Dockerfile` and `dockercompose.yml` for this project.
68
68
69
69
### Building the Docker image
70
70
71
71
If you do not have a GPU, run the following command:
72
72
73
73
```
74
-
docker-compose build
74
+
dockercompose build
75
75
```
76
76
77
77
If you do have a GPU that you wish to use, run the following command:
78
78
79
79
```
80
-
docker-compose -f docker-compose-gpu.yml build
80
+
dockercompose -f dockercompose-gpu.yml build
81
81
```
82
82
83
83
### Running the container
84
84
85
85
If you do not have a GPU, run the following command:
86
86
87
87
```
88
-
docker-compose up
88
+
dockercompose up
89
89
```
90
90
91
91
If you do have a GPU that you wish to use, run the following command:
92
92
93
93
```
94
-
docker-compose -f docker-compose-gpu.yml up
94
+
dockercompose -f dockercompose-gpu.yml up
95
95
```
96
96
97
97
Jupyter will be available in your local browser, on the port specified in your env file - for example
You can see how the Dockerfile can be thought of as a recipe for building a particular run-time environment. The magic of Docker is that you do not need to worry about installing a resource intensive virtual machine on your computer - Docker is lightweight and allows you to build an environment template purely using code.
71
71
72
-
A running version of an image is called a *container*. You can think of the image as like a cookie cutter, that can be used to create a particular cookie (the container). There is one other file that we need to look at before we finally get to build our image and run the container - the docker-compose.yaml file.
72
+
A running version of an image is called a *container*. You can think of the image as like a cookie cutter, that can be used to create a particular cookie (the container). There is one other file that we need to look at before we finally get to build our image and run the container - the dockercompose.yaml file.
73
73
74
-
## 🎼 The docker-compose.yaml file
74
+
## 🎼 The dockercompose.yaml file
75
75
76
-
Docker Compose is an extension to Docker that allows you to define how you would like your containers to run, through a simple YAML file, called 'docker-compose.yaml'.
76
+
Docker Compose is an extension to Docker that allows you to define how you would like your containers to run, through a simple YAML file, called 'dockercompose.yaml'.
77
77
78
78
For example, you can specify which ports and folders should be mapped between your machine and the container. Folder mapping allows the container to treat folders on your machine as if they were folders inside the container. Therefore any changes you make to mapped files and folders on your machine will be immediately reflected inside the container. Port mapping will forward any traffic on a local port through to the container. For example, we could map port 8888 on your local machine to port 8888 in the container, so that if you visit `localhost:8888` in your browser, you will see Jupyter, which is running on port 8888 inside the container. The ports do not have have to be the same - for example you could map port 8000 to port 8888 in the container if you wanted.
79
79
@@ -104,7 +104,7 @@ services: #<2>
104
104
1. This specifies the version of Docker Compose to use (currently version 3)
105
105
2. Here, we specify the services we wish to launch
106
106
3. We only have one service, which we call `app`
107
-
4. Here, we tell Docker where to find the Dockerfile (the same directory as the docker-compose.yaml file)
107
+
4. Here, we tell Docker where to find the Dockerfile (the same directory as the dockercompose.yaml file)
108
108
5. This allows us to open up an interactive command line inside the container, if we wish
109
109
6. Here, we map folders on our local machine (e.g. ./data), to folders inside the container (e.g. /app/data).
110
110
7. Here, we specify the port mappings - the dollar sign means that it will use the ports as specified in the `.env` file (e.g. `JUPYTER_PORT=8888`)
@@ -129,22 +129,22 @@ docker compose up
129
129
130
130
You should see that Docker launches the Jupyter notebook server within the container and provides you with a URL to the running server.
131
131
132
-
Because we have mapped port 8888 in the container to port 8888 on your machine, you can simply navigate to the address starting `http://127.0.0.1:8888/lab?token=` into a web browser and you should see the running Jupyter server. The folders that we mapped across in the `docker-compose.yaml` file should be visible on the left hand side.
132
+
Because we have mapped port 8888 in the container to port 8888 on your machine, you can simply navigate to the address starting `http://127.0.0.1:8888/lab?token=` into a web browser and you should see the running Jupyter server. The folders that we mapped across in the `dockercompose.yaml` file should be visible on the left hand side.
133
133
134
134
Congratulations! You now have a functioning Docker container that you can use to start working through the Generative Deep Learning codebase! To stop running the Jupyter server, you use `Ctrl-C` and to bring down the running container, you use the command `docker compose down`. Because the volumes are mapped, you won't lose any of your work that you save whilst working in the Jupyter notebooks, even if you bring the container down.
135
135
136
136
## ⚡️ Using a GPU
137
137
138
-
The default `Dockerfile` and `docker-compose.yaml` file assume that you do not want to use a local GPU to train your models. If you do have a GPU that you wish to use (for example, you are using a cloud VM), I have provided two extra files called `Dockerfile-gpu` and `docker-compose-gpu.yaml` files that can be used in place of the default files.
138
+
The default `Dockerfile` and `dockercompose.yaml` file assume that you do not want to use a local GPU to train your models. If you do have a GPU that you wish to use (for example, you are using a cloud VM), I have provided two extra files called `Dockerfile-gpu` and `dockercompose-gpu.yaml` files that can be used in place of the default files.
139
139
140
140
For example, to build an image that includes support for GPU, use the command shown below:
0 commit comments