2020/08/22
GCP: docker machine
GCP(Google Cloud Platform)์ Compute Engine ์ธ์คํด์ค์์๋ ๊ฐ์ํ ์ปจํ ์ด๋ ๊ธฐ๋ฅ์ ์ง์ํ์ง ์๋๋ค.
๊ทธ๋์ VirtualBox ๊ฐ์ ํ์ดํผ๋ฐ์ด์ ๋ฅผ ์ค์นํด๋, ๋์ปค ๋จธ์ ์ ๋๋ผ์ด๋ฒ๋ก ๋ง๋ค ์ ์๋ค. (Hosted ํํ์ ์ปจํ ์ด๋๊ฐ ์๋๋ค๋ ๋ป)
์๋ฌด๋ฆฌ ์ด๋ฏธ์ง๋ฅผ ๋ฐ๊ฟ๋ ๊ณ์ ๋ง๋ฌ๋ ์ค๋ฅ ๋ฉ์์ง:
joonas_yoon@gce-instance:~$ docker-machine create --driver virtualbox vm00
Running pre-create checks...
Error with pre-create check: "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory"
์ง์ง ๊ณ์ ์ฐพ์๋ดค๋๋ฐ, ์ ๋ถ ์๋๋ค.
https://github.com/docker/machine/issues/4590
์ ์ด์ ์ฐ๋ ๋์์ ํด๊ฒฐ๋๋ค๋ ์ฝ๋ฉํธ๋ค ๋ค ์๋๋ค. ์ธ์คํด์ค๊ฐ E2 ์ ํ์ด๊ฑด ์๋๊ฑด ๊ทธ๋ฅ ๋ค ์๋๋ค. N1 ํ์ ๋ ํด๋ดค๊ณ , Linux 16.04 LTS๋ ํด๋ณด๊ณ ๋ง์ผ์ ์๋ ์ด๋ฏธ์ง๋ ํด๋ดค๋ค.

Create machines on Google Compute Engine - https://docs.docker.com/machine/drivers/gce/
๋๋ผ์ด๋ฒ๋ฅผ google
์ ๋ง๊ฒ ์ค์ ํด์ค์ ํด๊ฒฐํ๋ค. key.json
์ ํ๋ก์ ํธ์์ ์ฌ์ฉํ๋ credentials.json ์ด๋ค.
joonas_yoon@gce-instance:~$ export GOOGLE_APPLICATION_CREDENTIALS=$HOME/key.json
joonas_yoon@gce-instance:~$ gcloud auth login
joonas_yoon@gce-instance:~$ docker-machine create --driver google --google-project <GOOGLE_PROJECT_ID> vm01
Running pre-create checks...
(vm01) Check that the project exists
(vm01) Check if the instance already exists
Creating machine...
(vm01) Generating SSH Key
(vm01) Creating host...
(vm01) Opening firewall ports
(vm01) Creating instance
(vm01) Waiting for Instance
(vm01) Uploading SSH Key
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env vm01
Last updated
Was this helpful?