Docker Build
Build Docker Image & run, start, stop and exit container
- by using shell command
$ bash docker/build.sh - or by using dockerfile directly
$ docker build Dockerfile - After built, run docker.(tagged_name: Image name)
$ docker run tagged_name - start container
$ docker container start container_id - access to bash shell
$ docker exec -it container_id bash - stop docker container
$ docker stop container_id - exit docker container in interactive responsive shell
ctrl + d - stop all running containers
$ docker stop $(docker ps -a -q) - Show docker disk usage
$ docker system df
Keep running Docker container
- add
ENTRYPOINTinDockerfileas last line.ENTRYPOINT ["tail", "-f", "/dev/null"]
Docker ENTRYPOINT Instruction
ENTRYPOINT ["tail", "-f", "/dev/null"] λ‘ ν΄μΌ keep running.
tail : 맨λ€μ λ€μ―μ€ λ³΄μ¬μ€
-f : νΌλλ₯Ό κ³μ μ½μ΄μ€
/dev/null: null μ κ³μ μ½μ΄μ€
For the future work.
Never write latest on the file name in any enviroment related files.
Write very specific version on every files in use for compatibility.
Leave a comment