–entrypoint라는 옵션은 container에서 강제로 실행하는 명령(echo, htpasswd)으로서 그 결과를 도커 호스트에 적용 및 저장할 수 있다
이것을 일회성 작업으로 활용할 때 유용하다(생성되어 실행된 container는 작업 후에 곧장 중지된다)
script를 실행하여 작업할 때도 유용하다
docker run –entrypoint echo centos hi > /root/hello.txt
cat /root/hello.txt
docker run –entrypoint htpasswd httpd -Bbn peace password > /root/htpasswd
cat /root/htpasswd
(다음 명령어와 동일하다
docker run httpd htpasswd -Bbn peace password > /root/htpasswd1 )
docker run –entrypoint ping centos 8.8.8.8