Enter the container
$ docker-compose exec #{container} bash
Stop / Delete
#Stop all containers
docker stop $(docker ps -q)
#Delete all containers
docker rm $(docker ps -q -a)
#Delete all images
docker rmi $(docker images -q)
Build
docker build [ -t {image name}[ :{Tag name}] ]{Directory with Dockerfile}
Start-up
$ docker run [option]image[:tag|@Digest value] [command] [argument...]
#rm:Automatic image deletion when container is closed
#name:Give the container a name
$ docker run --rm --name test -it image:tag bash
Copy between host and container
docker cp (ID or container name):(Path in the container) (Host path)
(ex)docker cp aabade1747be:/usr/local/apache2/conf/httpd.conf ./
Enter mysql
mysql -h host -u root -pmypass
Open in a tab by terminal
command + t
Recommended Posts