Instructions Docker

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#download docker image

docker pull

#find online docker image


docker search

#run image in container


docker run

#list containers
docker ps

#remove container
docker rm /<container name>

#list images
docker images

#remove image
docker rmi <image name>

#stop container
docker stop <container name>

#run mysql
docker run -td --name some-mysql -e MYSQL_ROOT_PASSWORD=pw -p 3306:3306
mysql/mysql-server

#login to mysql on container


docker exec -it some-mysql mysql -uroot -p

#login to mysql container bash


docker exec -it some-mysql bash

#display mysql log


cat /var/log/mysqld.log

#expose ports
docker port some-mysql

#create docker machine


docker-machine create <machine name>
docker-machine create -d hyperv --hyperv-virtual-switch "Primary Virtual Switch"
manager1

#list docker machines


docker-machines ls

#to enable connection to mysql in container


create user 'root'@'%' identified by 'pw';
grant all privileges on *.* to 'root'@'%';
select host,user from mysql.user;

You might also like