Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker on Google Cloud

Docker on Google Cloud

I gave this talk on using Docker with Google Cloud at the "Cloud Essentials" developer event, targeted towards beginners and junior software developers.

The Cloud Essentials event was hosted at FAST-NUCES in Lahore by GDSC and GDG.

Talk Video and more details at: https://shyr.io/t/docker-gcp

Sheharyar Naseer

March 06, 2023
Tweet

More Decks by Sheharyar Naseer

Other Decks in Technology

Transcript

  1. Technology advisor & consultant for startups, and Manager at Google

    Developers Group Find me anywhere @sheharyarn Sheharyar Naseer
  2. Background • Indie Nomad Software Architect • 12+ years of

    polyglot experience, focus on Web & Cloud • StackOverflow: 70,000+ score (Top 5 in Pakistan) • Author / Contributor of multiple famous libraries & tools • Featured on popular developer communities
  3. Outline Light Intro to Cloud Docker: What, Why & How

    Google Cloud Platform & Docker Live Demo Learning Resources Q&A
  4. Cloud Computing • On-demand access to computing resources, including servers,

    storage and networking infrastructure, hosted at a remote data-center • "Someone else's computer"
  5. Technology Verticals • Web & Mobile • ML / AI

    • Distributed Systems • Internet of Things • Mixed Reality
  6. Technology Verticals • Web & Mobile • ML / AI

    • Distributed Systems • Internet of Things • Mixed Reality CLOUD
  7. Careers in Cloud • Web Developer (Backend & Frontend) •

    Site Reliability Engineer • Software/Cloud Architect • Networking Specialist • Cloud Security Specialist • MLOps Engineer • Big Data Engineer
  8. Docker is becoming a fundamental tool for Professional Developers “

     StackOverflow Developer Survey 2022  2019 2020 2021 2022 69% 49% 39% 35%
  9. Docker – The What • "An open-source platform for containerizing

    applications and environments" • Docker Image: • Set of commands describing how to run your app • Write once, run anywhere • The "ABCs" of your Cloud journey
  10. Docker – The Why • Imagine buying a new computer

    • You set it up and install apps • Run system updates, etc. • Software: • Repeat steps on every fresh deploy • Manually run updates • Fix broken steps
  11. Docker – The Why • Ship code faster • Standardize

    operations • Save money • Simplify security • Run and deploy anywhere
  12. Docker – The How • Install Docker • Create a

    Dockerfile • Write steps to run app • Run it!
  13. Example – Java App FROM openjdk:8-jdk-alpine # Copy code WORKDIR

    /app COPY . . # Compile app RUN ./gradlew build RUN mv ./build/libs / * .jar ./app.jar # Start app CMD ["java", "-jar", "/app/app.jar"]
  14. Example – React App FROM node:16-alpine # Copy code WORKDIR

    /app COPY . . # Build app RUN npm ci RUN npm run build # Start the app CMD ["npx", "serve", "build"]
  15. Build and Run # Run Java App docker build -t

    demo-java:v1 . docker run -it -p 8080:8080 demo-java:v1 # Run React app docker build -t demo-react:v1 . docker run -it -p 3000:3000 demo-react:v1
  16. Google Cloud Platform • IaaS: Infrastructure as a Service •

    One of the "Big 3" • Servers, Storage, Databases, Networking, etc. • Extremely powerful
  17. GCP + Docker • World-class support for Docker • Cloud-native

    tooling • Build, Deploy and Run any Docker image • Simple experience
  18. Save Images to Cloud Registry # Setup gcloud login gcloud

    config project set ${PROJECT_ID} # Build and Save Image gcloud builds submit \ - - tag=gcr.io/${PROJECT_ID}/demo-react:v1 .
  19. Deploy with Cloud Run • Instantly deploy any container •

    Very simple UI • Deploy previously uploaded
  20. Helpful Resources KEEP LEARNING Docker • Official Docs: docs.docker.com •

    Friendly Guides: vsupalov.com/docker/ • Dockerfile Generator: cloudup.dev Google Cloud • Container Registry: cloud.google.com/container-registry/ • Cloud Run: cloud.google.com/run/docs/