Docker engine - Indroduc

381 views 16 slides Mar 04, 2017
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

docker introduce


Slide Content

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

M
u
lt
ip
l
ic
it
y
o
f

G
o
o
d
s
M
u
l
t
i
p
il
ic
it
y
o
f

m
e
t
h
o
d
s
f
o
r

t
r
a
n
s
p
o
r
t
in
g
/
s
t
o
r
in
g
D
o
I
w
o
r
r
y

a
b
o
u
t
h
o
w

g
o
o
d
s
i
n
t
e
r
a
c
t

(
e
.
g
.
c
o
f
f
e
e

b
e
a
n
s
n
e
x
t
t
o

s
p
ic
e
s
)
C
a
n
I
t
r
a
n
s
p
o
r
t

q
u
ic
k
l
y
a
n
d

s
m
o
o
t
h
ly
(
e
.
g
.
f
r
o
m
b
o
a
t

t
o
t
r
a
in
t
o
t
r
u
c
k
)
Cargo Transport Pre-1960

? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
Also a matrix from hell

Static website
Web frontend
Background workers
User DB
Analytics DB
Queue
Developmen
t VM
QA ServerSingle Prod
Server
Onsite
Cluster
Public CloudContributor’
s laptop
Customer
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.list
tambahkan
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 -v
sumber [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 Dockerfile
–FROM alpine
–CMD [“echo”, “Hello world”]

Docker build .

docker build -t test/myapp .

Docker run –name test “id”

Lanjutan, ubah ke dalam shell
script
●Nano Dockerfile
–FROM 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, Boulder…
and Nairobi. https://www.docker.io/meetups/