ibm cloud & cognitive — introduction to containers ...€¦ · • container orchestration...

20
IBM Cloud & Cognitive Introduction to containers: How to write a Dockerfile and build an image Hussah Alakee – Cloud Developer Advocate Cloud and Cognitive, IBM Saudi Email : [email protected] LinkedIn: https://www.linkedin.com/in/hessa-alaqeel-811964150/

Upload: others

Post on 18-Oct-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

IBM Cloud & Cognitive—

Introduction to containers: How to write a Dockerfile and build an image

Hussah Alakee – Cloud Developer Advocate

Cloud and Cognitive, IBM Saudi

Email: [email protected]: https://www.linkedin.com/in/hessa-alaqeel-811964150/

Page 2: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

Please Register through the link below

—https://ibm.biz/BdqCFi

Page 3: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

Lab Prerequisites

• Download the latest version of Docker

• Sign-up or sign-in on IBM Cloud: https://ibm.biz/BdqCFi

• Install IBM Cloud CLI : https://cloud.ibm.com/docs/cli/reference/ibmcloud?topic=cloud-cli-install-ibmcloud-cli

Page 4: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

Agenda

• What are containers• Containers Vs. Virtual machines • Beneifits of Containers • Container orchestration with Kubernetes• What is Docker • Why use Docker • Docker tools and terms• Dockerfile• Hands-on lab

Page 5: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

IBM Developer

What are Containers?

Page 6: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

IBM Developer

Different ArchitecturesContainers Vs. Virtual Machines

Page 7: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

IBM Developer

Beneifits of using Containers

• Containers are lightweight

• Portable and platform independent

• Supports modern development and architecture

• Improves utilization

Page 8: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

IBM Developer

Container orchestration with Kubernetes

• It can be complex to manage hundreds (or even thousands) of containers across a distributed system.

• To address this challenge, container orchestration emerged as a way managing large volumes of containers throughout their lifecycle.

• Kubernetes enables developers and operators to declare a desired state of their overall container environment

• Kubernetes does all the hard work establishing and maintaining that state, with activities that include deploying a specified number of instances of a given application or workload, rebooting that application if it fails, load balancing, auto-scaling, zero downtime deployments and more.

Page 9: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

IBM Developer

Docker

• Docker is an open platform for developing, shippingand running applications

• Docker makes it easier, simpler, and safer to build, deploy, and manage containers.

Page 10: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

IBM Developer

Why use Docker

• Improved and seamless portability

• Even lighter weight and more granular updates:

• Automated container creation

• Container versioning

• Container reuse

• Shared container libraries

Page 11: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

IBM Developer

Docker Image

- Contains executable application source code as well as all the tools, libraries, and dependencies that the application code needs to run as a container.

Docker Container

-Docker containers are the live, running instances of Docker images.

Docker tools and terms

Dockerfile

- A simple text file containing instructions for how to build the

Docker container image

Docker Hub

-Is the public repository of Docker images

Page 12: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

IBM Developer

Dockerfile

• Every Docker container starts with a simple text file containing

instructions for how to build the Docker container image.

• DockerFile automates the process of Docker image creation.

• A DockerFile is essentially a list of commands that Docker Engine will run

in order to assemble the image.

Page 13: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

Hands-on Lab

Page 14: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

Log-in to IBM Cloud

14

Page 15: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

Athuintication

15

Page 16: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

Create a container registry name-space

16

Page 17: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

Build and tag your container

17

Page 18: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

Thank you.

18

Hussah Alakeel

[email protected]

- Be part of our upcoming events on our Meetup page:

https://www.meetup.com/IBM-Developer-KSA

Page 19: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

Useful LinksLearn – develop – connect

IBM Developer (developer.ibm.com)

Red Hat courses (https://www.redhat.com/en/services/training/all-courses-exams)

Meetup Page (https://www.meetup.com/IBM-Cloud-MEA/)

Page 20: IBM Cloud & Cognitive — Introduction to Containers ...€¦ · • Container orchestration with Kubernetes • What is Docker • Why use Docker • Docker tools and terms • Dockerfile

20