Before start, install the Docker for this practice, see the references here about how to install the Docker for different platforms.
Below is the guide especially for Windows
as the macOS
one is very easy and straightforward:
-
In order to use Docker, disable
Hyper-v
by usingcmd
(Windows 10 only)
:bcdedit /set hypervisorlaunchtype off
In case you want to re-enable it after practice, here is the command:
bcdedit /set hypervisorlaunchtype auto
-
Install the Docker Toolbox, and make sure the
Virtualization
is enabled onWindows
. You can read this for reference, then click onGet Docker Toolbox for Windows
to start downloading the installer. -
After installing the Docker Toolbox, click the
Quick Start Terminal
on the desktop. If you have passed previous 2 steps, you will see a page for downloading oneboot2docker.iso
file. You can manually download and put it intoC:\Users\your_username\.docker\machine\cache
folder. (Copy theboot2docker.iso
from the USB provided on the class) -
You can close the
Quick Start Terminal
window, then usecmd
(refer toBuild Docker image
section on this page). Run a command:docker-machine ls
Then you should be able to see the default virtual machine.
-
Run
docker-machine env default
command. It will show some information about your environment. Choose the last row and run it manually. Then you will be able to run Docker in yourcmd
window, so here are the commands you need to execute:docker-machine env default
@FOR /f "TOKENS=*" %i IN ('docker-machine env default') DO %i
-
Remember the
IP address
in 2nd line as onWindows
, you will use it to access the application you're deploying on Docker.
You cannot just use localhost to access the service. Use the IP instead. The reason is there is a boot2docker VM running by VMBox. Docker connect with the VM directly. The IP is for the VM.
-
Note: You can use Virtual Box to check your
docker-machine
instance. If you are experiencing theVT-x
problem, please enable theVirtualization
in the BIOS, read the docs below about how to enable virtualization:
If there is an error of "this kernel requires an x86-64 CPU, but only detects an i686 CPU, unable to boot", please follow this guide
-
Please refer the doc here
-
Find
Docker
app in the macOS's Launchpad, then click on it to start it
Please read this reference carefully, and finish the Blockchain practice.