Docker-Busybox
Intro busybox ๋ ์๊ณ ๊ฐ๋ณ๊ณ ๋น ๋ฅธ POSIX ํ์ค ์ ํธ ๋ชจ์์ด๋ค. docker์์ ์ฌ๋ฌ ๊ฐ์ง๋ก ์์ฉํด์ ์ฌ์ฉํ ์ ์๋ค. ์์ฉ ์๋ฒ ๋๋ ์์คํ ์ ๋น๋ํ๊ธฐ Kubernates์ init container๋ก ์ฌ์ฉํ๊ธฐ HTTP ์น์๋ฒ๋ก ๋๋ฆฌ๊ธฐ ๊ฐ์์ปจํ ์ด๋ ๋ณผ๋ฅจ์๋ฒ(์คํ ๋ฆฌ์ง)๋ก ์ฌ์ฉํ๊ธฐ ๊ธฐ๋ณธ ์ฌ์ฉ๋ก busybox ์ต์ ๋ฒ์ ์ด๋ฏธ์ง ๋ฐ๊ณ ์คํ $ docker run -it --rm busybox busybox + myapp : myapp์ ๋ฆฌ๋ ์คํ๊ฒฝ์์ ์ ์ ์ปดํ์ผํ ๋ฐ์ด๋๋ฆฌ $ cat Dockerfile # Write Dockerfile FROM busybox COPY ./my-static-binary /my-static-binary CMD ["/my-static-binary"] $ docker build -t busybox-myapp . # Build Image $ docker run -t --rm busybox-myapp # Run Container busybox + httpserver : ์น์๋ฒ๋์(httpserver๋ static compile binary) $ cat Dockerfile # Write Dockerfile FROM busybox COPY ./httpserver /home/ CMD /home/httpserver $ docker build -t go-server . # Build Image $ docker run -p 8080:8080 --rm -it go-server # Run Container $ curl -v http://localhost:8080/ # Test Links How to Use th Busybox Docker Official Image https://www.docker.com/blog/use-cases-and-tips-for-using-the-busybox-docker-official-image/ Using the BusyBox Docker Image for Building Applications : A Complete Guide https://www.sohamkamani.com/docker/busybox-guide/