[Docker] Dockerfile build & image push

2024. 4. 1. 22:59ใ†ComputerScience/DockerKubernetes

 

 

 

 

2024. 04. 01 Monday

dockerfile buildํ•˜๋Š” ๊ณผ์ •

 

 

 

 

 

# ๋ช…๋ น์–ด 

ls -al

ls -al ๋ฐฉ์‹์„ ๊ฐ€์žฅ ๋งŽ์ด ์‚ฌ์šฉํ•œ๋‹ค.

ls -al/home/ ๊ณผ ๊ฐ™์ด ์ถœ๋ ฅํ•˜๊ณ  ์‹ถ์€ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

 

docker container ls 

์•„๋ฌด๊ฒƒ๋„ ์•ˆ ๋œธ

์‹คํ–‰์ค‘์ธ ๊ฒƒ๋งŒ ๋ณด์—ฌ์ค€๋‹ค 

 

docker container ls -a (—all) 

About a minute ago             py3

์‹คํ–‰์ด ์ค‘์ง€๋œ ์ปจํ…Œ์ด๋„ˆ๊นŒ์ง€ ๋‹ค ๋œธ

 

docker build -t myapp .

current directory๋ฅผ ์˜๋ฏธํ•˜๋Š” ์  (.)

 

docker run -it --rm --name py3 myapp

Hello, World!

 

์—ฌ๋Ÿฌ ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์žˆ์„ ๋•Œ, ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋ฉˆ์ถœ ๊ฒฝ์šฐ 

docker container ls -a -q 

๋งจ ์•ž์˜ ๋‚œ์ˆ˜๋งŒ ์ถœ๋ ฅ๋จ (CONTAINER ID)

 

 

 

 

 

# summary 

docker pull

docker build

docker image ls 

docker container run

docker container ls

docker container ls -a (--all)

docker container ls -a -q (-aq)

docker container stop

docker container kill

 

 

 

 

 

dockerfile build ์„ฑ๊ณต!

 

 

 

 

 

์ปจํ…Œ์ด๋„ˆ ์‹คํ–‰ (docker run)

 

 

 

 

 

docker hub์— push (ํƒœ๊ทธ๋ฅผ ์„ค์ •ํ•ด์•ผ ํ•œ๋‹ค!)

 

 

 

 

 

์ฐธ๊ณ ์ž๋ฃŒ 

https://ngela.tistory.com/70

 

[Dockerfile] ์ดˆ๋ณด์ž๋ฅผ ์œ„ํ•œ build ์™€ push ํ•˜๋Š” ๋ฐฉ๋ฒ•

docker ๋ฅผ ์‚ฌ์šฉํ•˜๋‹ค๋ณด๋ฉด ๋‚ด๊ฐ€ ํ•„์š”ํ•œ ์ด๋ฏธ์ง€๋ฅผ ๋งŒ๋“ค์–ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์ƒ๊ธฐ๊ณ , ์ด ์ปจํ…Œ์ด๋„ˆ ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•ด์„œ ์‚ฌ์šฉํ•ด์•ผํ•  ์ƒํ™ฉ์ด ๋ฐœ์ƒ๋œ๋‹ค. ์—ฌ๊ธฐ์„œ๋Š” ๊ฐ„๋‹จํžˆ ๋นŒ๋“œ๋ฅผ ํ•˜๊ณ , ์ด๊ฑธ private docker regist

ngela.tistory.com

https://github.com/pblischak/boost-docker-test

 

GitHub - pblischak/boost-docker-test: Test program for compiling/linking with the Boost C++ Libraries to create a Docker image

Test program for compiling/linking with the Boost C++ Libraries to create a Docker image - pblischak/boost-docker-test

github.com

https://www.boost.org

 

Boost C++ Libraries

Welcome to Boost.org! Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work well with the C++ Standard Library. Boost libraries are intended to be widely useful, and usable across a broad spectrum of applications

www.boost.org

https://hub.docker.com/repository/docker/sohyeonkimdev/cpp-websocket/general

 

Docker

 

hub.docker.com

 

 

 

 

 

 

'ComputerScience > DockerKubernetes' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Docker] M1 Docker-machine Error, Ubuntu ์„ค์น˜  (0) 2024.04.17
[Docker] CI/CD with Jenkins  (0) 2024.04.16
[Docker] Docker Compose  (0) 2024.04.08
[Docker] Getting started with Docker  (0) 2024.03.28
[Docker] Docker Image and Container  (0) 2024.03.21