Write what you learned about docker anyway \ (1st ) -Qiita
docker image build -t image name[:Tag name]Dockerfile location directory path
--The docker image build
command goes to find the Dockerfile by default
--But if you want to use a Dockerfile with a different name, use the -f option.
--For example, if you use a Dockerfile named Dockerfile-test, it will be as follows.
docker image build -f Dockerfile-test -t example/echo:latest
Use the docker search command to search the repository registered in the Docker Hub registry.
docker search [options]Search keyword
Use the --limit
option to limit the number of items displayed by the search command.
$ docker search --limit 5 mysql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 10014 [OK]
mysql/mysql-server Optimized MySQL Server Docker images. Create… 733 [OK]
mysql/mysql-cluster Experimental MySQL Cluster Docker images. Cr… 76
bitnami/mysql Bitnami MySQL Docker Image 45 [OK]
circleci/mysql MySQL is a widely used, open-source relation… 19
Docker image tags are used to help identify Docker images with a particular image ID --Image ID = Docker image version
Tag the latest specific point with the version name etc. so that you can get the specific version of docker image at any time.
docker image tag Original image name[:tag]New image name[:tag]
Example: tag example / echo latest with 0.1.0
docker image tag example/echo:latest example/echo:0.1.0
(output)
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
example/echo latest 4bc94bb3c1af 3 days ago 750MB
example/echo 0.1.0 4bc94bb3c1af 3 days ago 750MB
docker container restart container ID or container name
docker container rm container ID or container name
docker container cp [options]Container ID or container name:Copy source in container Copy destination of host
docker container cp [options]Host copy source container ID or container name:Copy in container-Ahead
--docker container prune
can delete all containers that are not running.
--Many of the containers that are actually stopped are often unnecessary, so it is better to delete them regularly.
docker container prune [option]
When you want to delete images at once
docker image prune [option]
Delete all unused Docker containers, images, volumes, networks, etc. at once
docker system prune [option]
Recommended Posts