Docker

Fast Help

Instruction

Command

Pull image

docker pull hello-world

List of containers images

docker images -a

Create container

docker create --name prismatic ubuntu

Run container

docker run hello-world

Get container id (Linux)

sudo docker ps -aqf "name=containername"

Get container id (Windows)

docker ps -aqf "name=containername"

Run a saved image

docker run -it -p 8091:8091 prismatic

Operational bash cmd

docker exec -ti 2769d51daeb2 bash

Commit cintainer

docker commit 2769d51daeb2

Stop container

docker stop 2769d51daeb2

Remove container

docker rm 2769d51daeb2

Remove image

docker rmi 2769d51daeb2

List of running container

docker ps

Clean and remove all container

docker system prune

Rename image

docker tag 18455f1ec44d "prismatic"

Create VM

docker-machine create –driver virtualbox –virtualbox-disk-size “40000” default

Delete VM

docker rm default

Docker login

docker login -u “myusername” -p “mypassword” docker.io

Docker ID

docker tag 18455f1ec44d mlhoutel/ubuntu_prismatic:latest

Docker push

docker push docker.io/mlhoutel/ubuntu_prismatic:latest

Connect to the VM

user: docker
pwd: tcuser

Get the VM ip with

ifconfig eth1

Set the azert keyboard

su docker
tce-load -wi kmaps
sudo loadkmap < /usr/share/kmap/azerty/fr-latin9.kmap

Use Putty

Session\Window\Selection\Action = Compromise
paste : ctrl + shift + V

Use SSH

ssh docker@ip_machine

Tutorial

Install nginx server

install nginx server: docker run -d -p 8080:80 nginx
open webpage: http://ip_machine:8080/

Edit nginx webpage:

cd /usr/share/nginx/html

Get Nano:

apt-get update
apt-get install apt-file
apt-file update
apt-get install nano