<commit_before>:linkattrs:

= Lab 03 (Technical) Deploying an application with Docker

_This is still an early stage lab. All that is required is that you do your best and present errors to the instructor and your classmates._

Learning objectives for this lab:

* Gain basic Docker skills using GCP
** Running pre-existing Docker containers
** Creating a Docker container with a simple application in it

== Set up a new empty repository on Github

On your Github account, set up an empty repo with the name "YOUREMAIL-dock-tut" (YOUREMAIL is your 8 char email account), and clone it down to your ~/repos directory on Google Cloud Shell. 

== Basic Docker skills
* Using the below code as a basis, create a simple Terraform file (`main.tf`) to create a container-optimized VM. 

....
provider "google" {
  project = "INSERT YOUR PROJECT NAME HERE"
  region  = "us-central1"
  zone    = "us-central1-c"
}
resource "google_compute_instance" "dock-tut" {
  name         = "dock-tut"
  machine_type = "f1-micro"
  zone         = "us-central1-c"
  boot_disk {
    initialize_params {
      image = "cos-cloud/cos-stable"
    }
  }
  network_interface {
    network = "default"
    access_config {
      // Ephemeral IP
    }
  }
}

....

* Log in via the web page (still working on getting ssh to work from command prompt immediately).

* Run https://cloud.google.com/cloud-build/docs/quickstart-docker[Quickstart for Docker^]

* Review https://cloud.google.com/compute/docs/containers/ 

* Run https://cloud.google.com/community/tutorials/docker-compose-on-container-optimized-os

* Noting any necessary adaptations, run the full Docker tutorial https://docs.docker.com/get-started/
** Part 1: you are running Docker in the cloud so you do not need to install it locally as these directions suggest.

* move your images and html file over to your new system

* Save your newly configured system as a new Github repo
<commit_msg>Update 03-tech-lab-v2.adoc<commit_after>:linkattrs:

= Lab 03 (Technical) Deploying an application with Docker

_This is still an early stage lab. All that is required is that you do your best and present errors to the instructor and your classmates._

Learning objectives for this lab:

* Gain basic Docker skills using GCP
** Running pre-existing Docker containers
** Creating a Docker container with a simple application in it

== Set up a new empty repository on Github

On your Github account, set up an empty repo with the name "YOUREMAIL-dock-tut" (YOUREMAIL is your 8 char email account), and clone it down to your ~/repos directory on Google Cloud Shell. 

== Basic Docker skills
* Using the below code as a basis, create a simple Terraform file (`main.tf`) to create a container-optimized VM. 

....
provider "google" {
  project = "INSERT YOUR PROJECT NAME HERE"
  region  = "us-central1"
  zone    = "us-central1-c"
}
resource "google_compute_instance" "dock-tut" {
  name         = "dock-tut"
  machine_type = "f1-micro"
  zone         = "us-central1-c"
  boot_disk {
    initialize_params {
      image = "cos-cloud/cos-stable"
    }
  }
  network_interface {
    network = "default"
    access_config {
      // Ephemeral IP
    }
  }
}

....

* Log in via the web page (still working on getting ssh to work from command prompt immediately).

* Run https://cloud.google.com/cloud-build/docs/quickstart-docker[Quickstart for Docker^]

* Review https://cloud.google.com/compute/docs/containers/ 

* Run https://cloud.google.com/community/tutorials/docker-compose-on-container-optimized-os

* Noting any necessary adaptations, run the full Docker tutorial https://docs.docker.com/get-started/
** Part 1: you are running Docker in the cloud so you do not need to install it locally as these directions suggest.
** In general you run it *within* your container-optimized VM or VMs, within the Cloud Shell. 

* move your images and html file over to your new system

* Save your newly configured system as a new Github repo

{'fraction_non_alphanumeric': 0.08463870641738251, 'fraction_numerical': 0.004800404244567963, 'mean_word_length': 3.493757094211124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3364354', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1133, 'n_words': 476}