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
The first example is a quick introduction into how to run the code
Add a second part to demonstrate how to edit the code and then re-create
the database.
Copy file name to clipboardexpand all lines: README-Docker.md
+27-4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,17 @@
1
1
# Docker README
2
2
3
+
<!-- vim-markdown-toc GFM -->
4
+
5
+
*[Getting Started](#getting-started)
6
+
*[Building Your Docker Container](#building-your-docker-container)
7
+
*[Refactoring Your Code](#refactoring-your-code)
8
+
*[Mapping your local volume to the Docker container](#mapping-your-local-volume-to-the-docker-container)
9
+
*[Creating the database](#creating-the-database)
10
+
11
+
<!-- vim-markdown-toc -->
12
+
13
+
## Getting Started
14
+
3
15
A `Dockerfile` has been provided in order to make this code more convenient to run. To get started via `Docker`, you'll need:
4
16
5
17
* A working Docker environment
@@ -17,7 +29,7 @@ docker build . -t mmdb-from-go
17
29
This will build your Docker container, build your `Go` code and also run the example code for you. To log in to your container, run this command. (Linux users may need to preface this command with `sudo`).
18
30
19
31
```bash
20
-
docker run -it --volume $(pwd):/project mmdb-from-go:latest /bin/bash
32
+
docker run -it mmdb-from-go:latest /bin/bash
21
33
```
22
34
23
35
Once you have logged in, you can test out your freshly created database:
You can freely edit the code outside of the Docker container and then re-run it from inside the container:
43
+
## Refactoring Your Code
44
+
45
+
You can freely edit the code outside of the Docker container and then re-run it from inside the container. To do so, you'll need to map your local volume to the container and then rebuild the database.
32
46
47
+
### Mapping your local volume to the Docker container
33
48
```bash
34
-
./mmdb-from-go-blogpost
35
-
```
49
+
docker run -it --volume $(pwd):/project mmdb-from-go:latest /bin/bash
50
+
```
51
+
52
+
### Creating the database
53
+
54
+
Once you are logged in to your container, run the following code:
0 commit comments