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도 해보고 λ§ˆμΌ“μ— μžˆλŠ” 이미지도 ν•΄λ΄€λ‹€.

λ“œλΌμ΄λ²„λ₯Ό 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