Course on LinuxAcademy Docker Deep Dive

Course Docker Deep Dive

Using the EC2 Container Service

EC2 Container Service

Useful resources

all the commands


link with the slides of the conference

command line instructions


install on ubuntu 14.04

Offline install on Red Had 6.5

You will need 64 bit RHEL 6.5 or later, with a RHEL 6 kernel version 2.6.32-431 or higher as this has specific kernel fixes to allow Docker to work.

rpm -Uvh
yum install yum-plugin-downloadonly
yum install --downloadonly --downloaddir=. docker-io.x86_64
#move the file package-name.rpm in the machine with internet connection
yum install package-name.rpm

start and test
service docker start
chkconfig docker on

docker on Mac OS X

install and run kinematic

to enable bash to run

eval $(docker-machine env default)

to test run
docker info
Containers: 1
 Running: 0

nice guide with first steps on Mac OS X

install brew it is only 1 command

Useful commands

install the latest version of docker by script

curl -sSL | sudo sh
docker pull ubuntu:14.04
docker run --name demo -d ubuntu:14.04 /bin/bash -c "while true;do sleep 10;done"

list running containers

root@vagrant-ubuntu-trusty-64:~# docker ps

list running containers by id

root@vagrant-ubuntu-trusty-64:~# docker ps -q
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                                               NAMES
ffebef0e4f24        mysql/mysql-server   "/ mysql"   4 minutes ago       Up 4 minutes

to stop the container use the container id
docker stop ffebef0e4f24

docker inspect demo

root@vagrant-ubuntu-trusty-64:~# docker inspect --format '{{.NetworkSettings.IPAddress}}' demo

docker run -t -e NAME="pEPPE" bootcamp:ex4 .

run mysql locally

docker pull mysql
docker run --name MYSQL255 -P -e MYSQL_ROOT_PASSWORD=mysecretpassword mysql:5.5

log in inside

docker exec -it MYSQL255 /bin/bash
root@c2433ce1416e:/# mysql -u root -pmysecretpassword -h -P 3306

install images offline


docker pull ubuntu
docker save -o ubuntu_image.docker ubuntu
#Transfer the file on the offline computer (USB/CD/whatever) and load the image from the file:
docker load < ubuntu_image.docker

check if the images was loaded

docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
leanlabs/redis      latest              ff17d301e723        7 months ago        6.051 MB

run the container

run the server the first time

docker run -d -p 6379:6379 --name kanban_redis leanlabs/redis
root@bsrpprd2018:~ # ps aux | grep docker
root      3935  0.0  0.1 522560 17596 pts/4    Sl   11:19   0:06 /usr/bin/docker -d
root     29837  0.2  0.0 198364  8680 pts/4    Sl   14:55   0:00 docker-proxy -proto tcp -host-ip -host-port 6379 -container-ip -container-port 6379
root     29920  0.0  0.0 103252   852 pts/4    S+   14:55   0:00 grep docker

run the service other times

docker start -a kaban_redis

delete all the images and containers

from the page

Delete all containers

docker rm $(docker ps -a -q)

Delete all images
docker rmi $(docker images -q)

Docker on Windows

put in debug mode

follow the instruction
it is important that you run this command

sc.exe config docker binpath=
from the "command prompt" and not from power shell 

+++ Find Logs
as it is explained in the link
you can print the log 
Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-5) | Sort-Object Time 
or save it in a file 
Get-EventLog -LogName Application -Source Docker -After (Get-Date).AddMinutes(-30)  | Sort-Object Time | Export-CSV ~/last30minutes.CSV

for the AWS ECS service you can find the log in the windows EC2 machine at this path C:\ProgramData\Amazon\ECS\log

Salvo diversa indicazione, il contenuto di questa pagina è sotto licenza Creative Commons Attribution-ShareAlike 3.0 License