docker engine - indroduc

Download Docker engine - Indroduc

If you can't read please download the document

Upload: jihar-al-gifari

Post on 11-Apr-2017

302 views

Category:

Technology


0 download

TRANSCRIPT

/

Introduction to Docker

Introduction to Docker

Jihar Al Gifari

What is Docker?

Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package

Multiplicity of GoodsMultipilicity of methods for transporting/storingDo I worry about how goods interact (e.g. coffee beans next to spices)Can I transport quickly and smoothly(e.g. from boat to train to truck)

Cargo Transport Pre-1960

???????

???????

???????

???????

???????

???????

Also a matrix from hell

Static websiteWeb frontend Background workersUser DBAnalytics DBQueueDevelopment VMQA ServerSingle Prod ServerOnsite ClusterPublic CloudContributors laptopCustomer Servers

Docker eliminates the matrix from Hell

Docker CLI

docker build # Build an image from a Dockerfile docker images # List all images on a Docker host docker run # Run an image docker ps # List all running and stopped instances docker stop # Stop a running instances docker rm # Remove an instance docker rmi # Remove an image

How to install Docker

uname -r.

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

sudo nano /etc/apt/sources.list.d/docker.listtambahkan deb https://apt.dockerproject.org/repo ubuntu-xenial main

Continued

sudo apt-get update

sudo apt-get purge lxc-docker

apt-cache policy docker-engine

sudo apt-get update && upgrade

sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual

Continued

sudo apt-get update

sudo apt-get install linux-image-generic-lts-trusty

sudo reboot

sudo apt-get update

sudo apt-get install docker-engine

sudo service docker start

sudo docker -vsumber [https://www.docker.com/products/overview]

Creating our first Docker container

Docker info

Docker run hello-world

Docker ps -a

Docker rm id

Docker rmi id

Create your Dockerfile, image and container

Nano DockerfileFROM alpine

CMD [echo, Hello world]

Docker build .

docker build -t test/myapp .

Docker run name test id

Lanjutan, ubah ke dalam shell script

Nano DockerfileFROM alpine

COPY script.sh /script.sh

CMD [/script.sh]

Nano script.sh#! /bin/sc

Echo Hello world

Sudo chmod +x script.sh Dockerfile

Lanjutan

Docker rm test

Docker build .

Docker run name test id

Want to learn more?

www.docker.io:

Documentation

Getting started: interactive tutorial, installation instructions, getting started guide,

About: Introductory whitepaper: http://www.docker.io/the-whole-story/

Github: dotcloud/docker

IRC: freenode/#docker

Google groups: groups.google.com/forum/#!forum/docker-user

Twitter: follow @docker

Meetups: Scheduled for Boston, San Francisco, Austin, London, Paris, Boulderand Nairobi. https://www.docker.io/meetups/