Google Docker
Objective
Learn how to set up a machine on Google Cloud.
Steps
- Create an account on Google Cloud
- Create a machine
- Specify which image to use and which flavor
- Insert your SSH Key
- Update Firewall Rules
- Connect to the Machine
- Download the pre-requisites, the installer & run the Installer pre script on the machine
- Zip docker certificates
Step 1: Create an account on Google Cloud
- Begin by Creating a Google Cloud account → Click Here.
- Follow the steps of Google Cloud wizard
Step 2: Create a machine
Step 3: Connect to the Machine
Once you add your public ssh key, the username shows up next to it in the google wizard. use that username to SSH the machine.
Connect to the Machine
# connect to the machine using the IP address > ssh %username%@%external ip address of machine%
External IP Address |
---|
Step 4: Download the pre-requisites, the installer & run the Installer pre script on Google Machine
Once you SSH to the machine, you can download and run the installer pre installation script to get all the dependencies so that cloud deployment works.
Prepare the machine
Download & Run SOAJS Installer pre scripts
# download update apt-get, npm and zip > sudo su > apt-get update && apt-get -y upgrade > apt-get install npm > apt-get install zip # download the latest version of nodejs > curl -sL https://deb.nodesource.com/setup_6.x | bash && apt-get install -y nodejs
Run the installer
# download installer > mkdir -p /opt/soajs/node_modules > cd /opt/soajs/node_modules > sudo npm install soajs.installer # run installer pre script > cd soajs.installer/scripts/pre > sudo /opt/soajs/node_modules/soajs.installer/scripts/pre/docker-linux.sh <%YOUR_CUSTOM_DOMAIN%>
Download Docker Certificates
Zip and Download the generated docker certificates from the above step to your local machine.
zip certificates
> cd /root > zip -r certs.zip certs/* > mv /root/certs.zip ~
From here on, use the installer from your local machine to deploy SOAJS on the remote machine you created.