Build an image from a Dockerfile
t : 태그 자동 지정-rm : Remove intermediate containers after a successful build--tag , -t : Name and optionally a tag in the 'name:tag' formatdocker build -t <username>/<respository> .
docker push <username>/<respository>
Docker runs processes in isolated containers. A container is a process which runs on a host.
The docker run command must specify an IMAGE to derive the container from.
With the docker run [OPTIONS] an operator can add to or override the image defaults set by a developer. And, additionally, operators can override nearly all the defaults set by the Docker runtime itself.
docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]
docker run -d -p 80:80 my_image
docker run --name my-redis -d redis
Docker to automatically clean up the container and remove the file system when the container exits, you can add the --rm flag:
--rm=false: Automatically remove the container when it exits
docker images
docker rmi [OPTIONS] IMAGE
-rm-d-pdocker run --rm -d -p 8080:8080 --name <container-name> <username>/<repository>
docker ps -a
--followdocker container logs --follow CONTAINER
Stop one or more running containers
docker container stop [OPTIONS] CONTAINER [CONTAINER...]
Remove one or more containers
---force, -f
docker container rm [OPTIONS] CONTAINER [CONTAINER...]
This removes the container referenced under the link /redis.
docker rm /redis
docker ps --filter status=exited -q | xargs docker rm
This command force-removes a running container.
docker rm --force redis
docker remove <imagename>