Docker Blog Posts

Docker Notes basic commands in docker

Docker starting nginx Web Server
docker container run --publish 80:80 nginx
run as detach mode
docker container run --publish 80:80 --detach nginx
giving a name to container
docker container run --publish 80:80 --detach --name webhost nginx
docker container logs webhost

0 Likes 915 Views
Docker Notes basic docker images

docker image ls
docker pull nginx
docker pull nginx:1.11
docker pull nginx:1.11.9-alpine
docker history nginx
docker image inspect nginx
image tagging

0 Likes 853 Views
Docker Notes 3 container volumes and data

Data Volumes
docker container run -d -p 3307:3306 --name mysql_db -e MYSQL_RANDOM_ROOT_PASSWORD=True mysql
docker volume ls
docker volume inspect
We can't say which volume is attached to which container
named volumes
docker container run -d -p 3307:3306 --name mysql_db1 -e MYSQL_RANDOM_ROOT_PASSWORD=True -v mysql_data:/var/lib/mysql mysql

0 Likes 855 Views
Docker Notes 4 docker swarm

By default inactive
docker swarm init
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-5dwktx410vuftgekfht2av182j0aie65bs2e1smhwehbhogwsq-2uenh58uniqgihh5vtu30lzxc 192.168.65.3:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions
docker node ls
docker node --help

0 Likes 865 Views