docker pull [OPTIONS] NAME[:TAG|@DIGEST]
docker images [OPTIONS] [REPOSITORY[:TAG]]
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
docker run httpd
docker run --name secondContainer httpd
docker run -p 8888:80 -v /Users/jk/wanted/2308/docker-pro-2308/lecture/1st:/usr/local/apache2/htdocs httpd
docker start [OPTIONS] CONTAINER [CONTAINER...]
docker start c8274d6a6273
docker stop [OPTIONS] CONTAINER [CONTAINER...]
docker stop 9b0f49de746c
docker stop -a
docker logs [OPTIONS] CONTAINER
docker logs second
docker logs second -f
docker rm [OPTIONS] CONTAINER [CONTAINER...]
docker rm 6026ab9b44cc
docker rm second -f
docker rmi [OPTIONS] IMAGE [IMAGE...]
docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
docker exec -it awesome_elion /bin/sh
docker container prune [OPTIONS]
docker container stats [OPTIONS] [CONTAINER...]
docker image prune [OPTIONS]
docker image inspect [OPTIONS]
docker image inspect httpd
docker image tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
docker image tag my-httpd drumgrammer/my-httpd:latest
docker push [OPTIONS] NAME[:TAG]
docker push drumgrammer/my-httpd:latest
docker login [OPTIONS] [SERVER]
docker system prune [OPTIONS]
- Dockerfile 예제
FROM httpd:latest
COPY index.html /usr/local/apache2/htdocs/index.html
EXPOSE 80
- 이미지 만들기
docker build -t my-httpd .
- 도커파일로 생성된 이미지로 컨테이너 실행하기
docker run -d -p 8888:80 my-httpd