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
ENTRYPOINT
inDockerfile
as 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